@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,110 +1,197 @@
|
|
|
1
1
|
require('source-map-support').install();
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { EnduserSession } from "../../enduser"
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "
|
|
10
|
-
import { setup_tests } from "../setup"
|
|
5
|
+
assert_checks,
|
|
6
|
+
Check,
|
|
7
|
+
setup_isolated_tenant,
|
|
8
|
+
IsolatedSuite,
|
|
9
|
+
} from "../setup_isolated"
|
|
11
10
|
|
|
12
11
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
// The critical security property: configurations hold sensitive integration settings (API keys etc.),
|
|
17
|
-
// so enduser read access is opt-in PER RECORD via publicRead: true. A configuration without the flag
|
|
18
|
-
// must remain completely invisible to enduser sessions, and endusers must never be able to write
|
|
19
|
-
// configurations at all.
|
|
20
|
-
export const configurations_public_read_tests = async ({ sdk } : { sdk: Session, sdkNonAdmin: Session }) => {
|
|
21
|
-
log_header("Configurations publicRead Tests")
|
|
13
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
22
14
|
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
/** A rejection carries no status and no consistent shape: parseError throws the raw response body, so
|
|
16
|
+
* a 404 arrives as `{ message, info }` while a 401 arrives as the plain string 'Unauthenticated'
|
|
17
|
+
* (`res.status(401).end(...)`, not JSON). Without this normalization the write checks would match
|
|
18
|
+
* nothing and pass vacuously. */
|
|
19
|
+
const error_text = (err: any): string => (
|
|
20
|
+
typeof err === 'string' ? err : err?.message ?? String(err)
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Coverage for the `configurations` publicRead flag (added for AI form translation maps).
|
|
25
|
+
*
|
|
26
|
+
* The critical security property: configurations hold sensitive integration settings (API keys etc.),
|
|
27
|
+
* so enduser read access is opt-in PER RECORD via `publicRead: true` — `enduserActions` on the model is
|
|
28
|
+
* `{ read, readMany }` only, and `build_enduser_filter` (api database.ts) reduces those reads to
|
|
29
|
+
* records carrying the flag. A configuration without the flag must remain completely invisible to
|
|
30
|
+
* enduser sessions, and endusers must never be able to write configurations at all.
|
|
31
|
+
*
|
|
32
|
+
* This suite provisions its own throwaway tenant, so it needs no environment fixture. That also makes
|
|
33
|
+
* the `getSome` result determinate — the provisioner inserts no configurations, so the only records in
|
|
34
|
+
* the business are the two created here, and the check can assert on an exact result rather than
|
|
35
|
+
* "contains". It never calls `sdk.reset_db()`, which clears global throttle namespaces shared with
|
|
36
|
+
* other concurrently running suites.
|
|
37
|
+
*/
|
|
38
|
+
export const configurations_public_read_checks = async (): Promise<Check[]> => {
|
|
39
|
+
const checks: Check[] = []
|
|
40
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
41
|
+
|
|
42
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
25
43
|
|
|
26
44
|
try {
|
|
45
|
+
tenant = await setup_isolated_tenant({
|
|
46
|
+
name: `ConfigurationsPublicRead ${RAND()}`,
|
|
47
|
+
users: [{ isAdmin: true }],
|
|
48
|
+
apiKeys: 0,
|
|
49
|
+
})
|
|
50
|
+
const { sdk } = tenant
|
|
51
|
+
|
|
27
52
|
// config A simulates an integration config (no flag); config B is a flagged translation-map-style record
|
|
28
53
|
const configA = await sdk.api.configurations.createOne({
|
|
29
54
|
type: 'test-private-configuration',
|
|
30
55
|
value: JSON.stringify({ apiKey: 'super-secret' }),
|
|
31
56
|
})
|
|
32
|
-
createdConfigurationIds.push(configA.id)
|
|
33
|
-
|
|
34
57
|
const configB = await sdk.api.configurations.createOne({
|
|
35
58
|
type: 'test-public-configuration',
|
|
36
59
|
value: JSON.stringify({ Hello: 'Hola' }),
|
|
37
60
|
publicRead: true,
|
|
38
61
|
})
|
|
39
|
-
createdConfigurationIds.push(configB.id)
|
|
40
62
|
|
|
41
63
|
const enduser = await sdk.api.endusers.createOne({
|
|
42
|
-
email: `
|
|
64
|
+
email: `configurations-public-read-${RAND()}@tellescope.example`,
|
|
43
65
|
})
|
|
44
|
-
enduserId = enduser.id
|
|
45
66
|
|
|
46
|
-
|
|
47
|
-
|
|
67
|
+
/** Session.errorHandler calls clearState() whenever the parsed error is exactly 'Unauthenticated',
|
|
68
|
+
* wiping authToken. So every check that expects a 401 gets a freshly minted token and session —
|
|
69
|
+
* a shared one would be unauthenticated for the 2nd and 3rd write checks, which would then pass
|
|
70
|
+
* even with the access boundary deleted. */
|
|
71
|
+
const enduser_session = async () => {
|
|
72
|
+
const { authToken } = await sdk.api.endusers.generate_auth_token({ id: enduser.id })
|
|
73
|
+
const session = new EnduserSession({ host, authToken, businessId: tenant!.businessId })
|
|
74
|
+
await session.refresh_session()
|
|
75
|
+
return session
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* ===================== reads (no 401 expected, so one session is safe) ===================== */
|
|
79
|
+
|
|
80
|
+
const readSession = await enduser_session()
|
|
48
81
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
82
|
+
let publicReadConfig: any
|
|
83
|
+
let publicReadError = ''
|
|
84
|
+
try {
|
|
85
|
+
publicReadConfig = await readSession.api.configurations.getOne(configB.id)
|
|
86
|
+
} catch (err: any) { publicReadError = error_text(err) }
|
|
87
|
+
record(
|
|
88
|
+
'A: enduser CAN read a publicRead configuration by id',
|
|
89
|
+
publicReadConfig?.id === configB.id && publicReadConfig?.value === configB.value,
|
|
90
|
+
`read=${JSON.stringify(publicReadConfig)}`
|
|
91
|
+
+ (publicReadError ? ` error=${JSON.stringify(publicReadError)}` : ''),
|
|
54
92
|
)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
93
|
+
|
|
94
|
+
let unflaggedReadError = ''
|
|
95
|
+
let unflaggedRead: any
|
|
96
|
+
try {
|
|
97
|
+
unflaggedRead = await readSession.api.configurations.getOne(configA.id)
|
|
98
|
+
} catch (err: any) { unflaggedReadError = error_text(err) }
|
|
99
|
+
record(
|
|
100
|
+
'B: enduser CANNOT read an unflagged configuration by id (key security assertion)',
|
|
101
|
+
unflaggedReadError === 'Could not find a record for the given id',
|
|
102
|
+
unflaggedReadError
|
|
103
|
+
? `error=${JSON.stringify(unflaggedReadError)}`
|
|
104
|
+
: `(none — the read RETURNED ${JSON.stringify(unflaggedRead)})`,
|
|
59
105
|
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)},
|
|
106
|
+
|
|
107
|
+
const someConfigurations = await readSession.api.configurations.getSome({})
|
|
108
|
+
record(
|
|
109
|
+
'C: enduser getSome returns exactly one configuration — the publicRead one',
|
|
110
|
+
someConfigurations.length === 1 && someConfigurations[0].id === configB.id,
|
|
111
|
+
`ids=${JSON.stringify(someConfigurations.map(c => c.id))} (publicRead=${configB.id}, unflagged=${configA.id})`,
|
|
67
112
|
)
|
|
68
113
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
114
|
+
/* ============ writes: endusers have no create/update/delete on configurations ============ */
|
|
115
|
+
|
|
116
|
+
/** A write session, proven authenticated at the moment of the write.
|
|
117
|
+
*
|
|
118
|
+
* Both steps guard against the same vacuous pass. These checks match on the literal string
|
|
119
|
+
* 'Unauthenticated', which is also what an invalid or cleared token rejects with — so a session
|
|
120
|
+
* that simply failed to authenticate would satisfy them with the access boundary deleted. The
|
|
121
|
+
* publicRead read is the proof that it did authenticate, and running it (and refresh_session)
|
|
122
|
+
* OUTSIDE each check's try means a failure throws out of the suite instead of being recorded as
|
|
123
|
+
* the expected rejection. */
|
|
124
|
+
const authenticated_write_session = async () => {
|
|
125
|
+
const session = await enduser_session()
|
|
126
|
+
await session.api.configurations.getOne(configB.id)
|
|
127
|
+
return session
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const createSession = await authenticated_write_session()
|
|
131
|
+
let createError = ''
|
|
132
|
+
let created: any
|
|
133
|
+
try {
|
|
134
|
+
created = await createSession.api.configurations.createOne({
|
|
135
|
+
type: 'test-enduser-create', value: '{}', publicRead: true,
|
|
136
|
+
})
|
|
137
|
+
} catch (err: any) { createError = error_text(err) }
|
|
138
|
+
record(
|
|
139
|
+
'D: enduser CANNOT create a configuration',
|
|
140
|
+
createError === 'Unauthenticated',
|
|
141
|
+
createError
|
|
142
|
+
? `error=${JSON.stringify(createError)}`
|
|
143
|
+
: `(none — the write was ACCEPTED as ${JSON.stringify(created?.id)})`,
|
|
74
144
|
)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
145
|
+
|
|
146
|
+
const updateSession = await authenticated_write_session()
|
|
147
|
+
let updateError = ''
|
|
148
|
+
try {
|
|
149
|
+
await updateSession.api.configurations.updateOne(configB.id, { value: '{}' })
|
|
150
|
+
} catch (err: any) { updateError = error_text(err) }
|
|
151
|
+
record(
|
|
152
|
+
'E: enduser CANNOT update a configuration (even a publicRead one)',
|
|
153
|
+
updateError === 'Unauthenticated',
|
|
154
|
+
updateError ? `error=${JSON.stringify(updateError)}` : '(none — the write was ACCEPTED)',
|
|
79
155
|
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
156
|
+
|
|
157
|
+
const deleteSession = await authenticated_write_session()
|
|
158
|
+
let deleteError = ''
|
|
159
|
+
try {
|
|
160
|
+
await deleteSession.api.configurations.deleteOne(configB.id)
|
|
161
|
+
} catch (err: any) { deleteError = error_text(err) }
|
|
162
|
+
record(
|
|
163
|
+
'F: enduser CANNOT delete a configuration',
|
|
164
|
+
deleteError === 'Unauthenticated',
|
|
165
|
+
deleteError ? `error=${JSON.stringify(deleteError)}` : '(none — the write was ACCEPTED)',
|
|
84
166
|
)
|
|
85
167
|
|
|
86
168
|
// staff access is unchanged by the flag
|
|
87
169
|
const staffRead = await sdk.api.configurations.getOne(configA.id)
|
|
88
|
-
|
|
170
|
+
record(
|
|
171
|
+
'G: staff reads an unflagged configuration',
|
|
172
|
+
staffRead?.id === configA.id,
|
|
173
|
+
`read=${JSON.stringify(staffRead?.id)} (expected ${configA.id})`,
|
|
174
|
+
)
|
|
89
175
|
} finally {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
if (enduserId) await sdk.api.endusers.deleteOne(enduserId).catch(() => {})
|
|
176
|
+
// Teardown BEFORE anything asserts — assert calls process.exit, which would strand this tenant.
|
|
177
|
+
if (tenant) { try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) } }
|
|
94
178
|
}
|
|
179
|
+
|
|
180
|
+
return checks
|
|
95
181
|
}
|
|
96
182
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
183
|
+
/** Asserting wrapper, for standalone runs and for sequential use in the suite. */
|
|
184
|
+
export const configurations_public_read_tests = async () => {
|
|
185
|
+
assert_checks('Configurations publicRead', await configurations_public_read_checks())
|
|
186
|
+
}
|
|
101
187
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
await configurations_public_read_tests({ sdk, sdkNonAdmin })
|
|
105
|
-
}
|
|
188
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
189
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'Configurations publicRead', run: configurations_public_read_checks }
|
|
106
190
|
|
|
107
|
-
|
|
191
|
+
// Allow running this test file independently
|
|
192
|
+
if (require.main === module) {
|
|
193
|
+
console.log(`🌐 Using API URL: ${host}`)
|
|
194
|
+
configurations_public_read_tests()
|
|
108
195
|
.then(() => {
|
|
109
196
|
console.log("✅ Configurations publicRead test suite completed successfully")
|
|
110
197
|
process.exit(0)
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
require('source-map-support').install();
|
|
2
|
+
|
|
3
|
+
import { EnduserSession, Session } from "../../sdk"
|
|
4
|
+
import {
|
|
5
|
+
assert_checks,
|
|
6
|
+
Check,
|
|
7
|
+
setup_isolated_tenant,
|
|
8
|
+
IsolatedSuite,
|
|
9
|
+
} from "../setup_isolated"
|
|
10
|
+
import { Enduser, FormResponse } from "@tellescope/types-client"
|
|
11
|
+
import { FormResponseValue } from "@tellescope/types-models"
|
|
12
|
+
|
|
13
|
+
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
14
|
+
|
|
15
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Coverage for CU-86dzm9g7e: a form response COPIED onto another patient's profile (Save Copy to
|
|
19
|
+
* Related Contact(s), the submit_form_response fan-out, the Tickets card — all stamp `copiedFrom`)
|
|
20
|
+
* must never write its answers into the holding patient's profile fields.
|
|
21
|
+
*
|
|
22
|
+
* The guard is a single early return in `save_enduser_updates_for_form_response`
|
|
23
|
+
* (api/modules/forms.ts), keyed on `copiedFrom` alone and placed above every write in that function.
|
|
24
|
+
* The side effect runs AFTER the update response returns (handle_enduser_updates_for_form_response
|
|
25
|
+
* fires it without awaiting), so every assertion here polls.
|
|
26
|
+
*
|
|
27
|
+
* Proving a negative needs both a barrier and a control, or the suite passes vacuously whenever the
|
|
28
|
+
* sync pipeline is simply slow or dead:
|
|
29
|
+
* - barrier + control: patient B also owns a NON-copied response answering its own distinct intake
|
|
30
|
+
* field. It is edited after the copy, and the suite waits until THAT field lands on B. So the
|
|
31
|
+
* sync pipeline is proven live for B, and the copy's edit has had at least as long to land.
|
|
32
|
+
* - positive control: editing patient A's own (original) response still writes A's profile fields.
|
|
33
|
+
* Each intake field is answered by exactly one response, so a blocked write cannot be masked by a
|
|
34
|
+
* later allowed one.
|
|
35
|
+
*
|
|
36
|
+
* `setup_isolated` rather than `setup_tests`: these checks assert on the exact field values of two
|
|
37
|
+
* contacts over time, which needs a tenant no concurrently running suite writes to.
|
|
38
|
+
*
|
|
39
|
+
* Runs standalone or as part of the main suite:
|
|
40
|
+
* npm run test:modular -- api_tests/copied_form_response_no_enduser_sync
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))
|
|
44
|
+
|
|
45
|
+
/** Re-reads until `done`, or gives up and returns the last value read (the caller asserts on it). */
|
|
46
|
+
const poll_until = async <T>(read: () => Promise<T>, done: (value: T) => boolean, {
|
|
47
|
+
attempts = 30,
|
|
48
|
+
intervalMS = 500,
|
|
49
|
+
} = {}): Promise<T> => {
|
|
50
|
+
let latest = await read()
|
|
51
|
+
for (let i = 0; i < attempts && !done(latest); i++) {
|
|
52
|
+
await sleep(intervalMS)
|
|
53
|
+
latest = await read()
|
|
54
|
+
}
|
|
55
|
+
return latest
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const answer = (fieldId: string, fieldTitle: string, value: string | number) => ({
|
|
59
|
+
fieldId,
|
|
60
|
+
fieldTitle,
|
|
61
|
+
answer: { type: typeof value === 'number' ? 'number' : 'string', value } as FormResponseValue['answer'],
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
export const copied_form_response_no_enduser_sync_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
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
tenant = await setup_isolated_tenant({
|
|
72
|
+
name: `CopiedFormResponseSync ${RAND()}`,
|
|
73
|
+
users: [{ isAdmin: true }],
|
|
74
|
+
apiKeys: 0,
|
|
75
|
+
})
|
|
76
|
+
const { sdk } = tenant as { sdk: Session }
|
|
77
|
+
|
|
78
|
+
// one intake field per response, so no write can mask another
|
|
79
|
+
const COPY_KEY = `copiedAnswer${RAND()}` // answered by the original on A, and by the copy on B
|
|
80
|
+
const OWN_KEY = `ownAnswer${RAND()}` // answered only by B's own, non-copied response
|
|
81
|
+
|
|
82
|
+
const form = await sdk.api.forms.createOne({ title: `Copied Response Sync ${RAND()}` })
|
|
83
|
+
const genderField = await sdk.api.form_fields.createOne({
|
|
84
|
+
formId: form.id, title: 'Gender', type: 'string', intakeField: 'gender',
|
|
85
|
+
previousFields: [{ type: 'root', info: {} }],
|
|
86
|
+
})
|
|
87
|
+
const copyField = await sdk.api.form_fields.createOne({
|
|
88
|
+
formId: form.id, title: 'Copied Answer', type: 'string', intakeField: COPY_KEY,
|
|
89
|
+
previousFields: [{ type: 'after', info: { fieldId: genderField.id } }],
|
|
90
|
+
})
|
|
91
|
+
const ownField = await sdk.api.form_fields.createOne({
|
|
92
|
+
formId: form.id, title: 'Own Answer', type: 'string', intakeField: OWN_KEY,
|
|
93
|
+
previousFields: [{ type: 'after', info: { fieldId: copyField.id } }],
|
|
94
|
+
})
|
|
95
|
+
// no intakeField — only feeds the score, which must still be recalculated on a copy
|
|
96
|
+
const scoreField = await sdk.api.form_fields.createOne({
|
|
97
|
+
formId: form.id, title: 'Score Me', type: 'number',
|
|
98
|
+
previousFields: [{ type: 'after', info: { fieldId: ownField.id } }],
|
|
99
|
+
})
|
|
100
|
+
await sdk.api.forms.updateOne(form.id, {
|
|
101
|
+
scoring: [{ title: 'Total', fieldId: scoreField.id, score: 'value' }],
|
|
102
|
+
}, { replaceObjectFields: true })
|
|
103
|
+
|
|
104
|
+
const patientA = await sdk.api.endusers.createOne({ fname: 'Copied', lname: `SourceA${RAND()}` })
|
|
105
|
+
const patientB = await sdk.api.endusers.createOne({ fname: 'Copied', lname: `RelatedB${RAND()}` })
|
|
106
|
+
|
|
107
|
+
const readA = () => sdk.api.endusers.getOne(patientA.id)
|
|
108
|
+
const readB = () => sdk.api.endusers.getOne(patientB.id)
|
|
109
|
+
|
|
110
|
+
/* ===== 1. positive control: editing A's OWN response writes A's profile fields ===== */
|
|
111
|
+
const { response: originalPlaceholder } = await sdk.api.form_responses.prepare_form_response({
|
|
112
|
+
formId: form.id,
|
|
113
|
+
enduserId: patientA.id,
|
|
114
|
+
})
|
|
115
|
+
const original = await sdk.api.form_responses.updateOne(originalPlaceholder.id, {
|
|
116
|
+
responses: [
|
|
117
|
+
answer(genderField.id, 'Gender', 'Male'),
|
|
118
|
+
answer(copyField.id, 'Copied Answer', 'FROM_A'),
|
|
119
|
+
],
|
|
120
|
+
}, { replaceObjectFields: true })
|
|
121
|
+
|
|
122
|
+
const afterOriginalEdit = await poll_until(
|
|
123
|
+
readA,
|
|
124
|
+
(a: Enduser) => a.gender === 'Male' && a.fields?.[COPY_KEY] === 'FROM_A',
|
|
125
|
+
)
|
|
126
|
+
record(
|
|
127
|
+
'positive control: editing a patient\'s OWN response still writes their profile fields',
|
|
128
|
+
afterOriginalEdit.gender === 'Male' && afterOriginalEdit.fields?.[COPY_KEY] === 'FROM_A',
|
|
129
|
+
`patient A after the edit: gender=${JSON.stringify(afterOriginalEdit.gender)},`
|
|
130
|
+
+ ` fields.${COPY_KEY}=${JSON.stringify(afterOriginalEdit.fields?.[COPY_KEY])};`
|
|
131
|
+
+ ` expected "Male" / "FROM_A" (if this fails, every negative check below is vacuous)`,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
/* ===== 2. the copy itself, as the webapp creates it: same answers, stamped copiedFrom ===== */
|
|
135
|
+
const copy = await sdk.api.form_responses.createOne({
|
|
136
|
+
formId: form.id,
|
|
137
|
+
formTitle: form.title,
|
|
138
|
+
enduserId: patientB.id,
|
|
139
|
+
copiedFrom: original.id,
|
|
140
|
+
copiedFromEnduserId: patientA.id,
|
|
141
|
+
})
|
|
142
|
+
record(
|
|
143
|
+
'fixture: the copy carries copiedFrom and copiedFromEnduserId',
|
|
144
|
+
copy.copiedFrom === original.id && copy.copiedFromEnduserId === patientA.id,
|
|
145
|
+
`copy ${copy.id}: copiedFrom=${copy.copiedFrom} (expected ${original.id}),`
|
|
146
|
+
+ ` copiedFromEnduserId=${copy.copiedFromEnduserId} (expected ${patientA.id})`,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
/* ===== 3. editing the copy must not touch B's profile fields ===== */
|
|
150
|
+
await sdk.api.form_responses.updateOne(copy.id, {
|
|
151
|
+
responses: [
|
|
152
|
+
answer(genderField.id, 'Gender', 'Female'),
|
|
153
|
+
answer(copyField.id, 'Copied Answer', 'FROM_COPY'),
|
|
154
|
+
answer(scoreField.id, 'Score Me', 7),
|
|
155
|
+
],
|
|
156
|
+
}, { replaceObjectFields: true })
|
|
157
|
+
|
|
158
|
+
// BARRIER + CONTROL: B's own, non-copied response is edited after the copy and waited on, so the
|
|
159
|
+
// copy's side effect has had at least as long to run, on a pipeline proven live for this patient
|
|
160
|
+
const { response: ownPlaceholder } = await sdk.api.form_responses.prepare_form_response({
|
|
161
|
+
formId: form.id,
|
|
162
|
+
enduserId: patientB.id,
|
|
163
|
+
})
|
|
164
|
+
await sdk.api.form_responses.updateOne(ownPlaceholder.id, {
|
|
165
|
+
responses: [answer(ownField.id, 'Own Answer', 'FROM_OWN')],
|
|
166
|
+
}, { replaceObjectFields: true })
|
|
167
|
+
|
|
168
|
+
const afterCopyEdit = await poll_until(
|
|
169
|
+
readB,
|
|
170
|
+
(b: Enduser) => b.fields?.[OWN_KEY] === 'FROM_OWN',
|
|
171
|
+
)
|
|
172
|
+
record(
|
|
173
|
+
'barrier: B\'s own (non-copied) response DOES write B\'s profile fields',
|
|
174
|
+
afterCopyEdit.fields?.[OWN_KEY] === 'FROM_OWN',
|
|
175
|
+
`patient B fields.${OWN_KEY}=${JSON.stringify(afterCopyEdit.fields?.[OWN_KEY])}, expected "FROM_OWN"`
|
|
176
|
+
+ ` (if this fails the sync pipeline never ran and the checks below prove nothing)`,
|
|
177
|
+
)
|
|
178
|
+
record(
|
|
179
|
+
'editing a COPIED response does not write the custom profile field',
|
|
180
|
+
afterCopyEdit.fields?.[COPY_KEY] === undefined,
|
|
181
|
+
`patient B fields.${COPY_KEY}=${JSON.stringify(afterCopyEdit.fields?.[COPY_KEY])}, expected undefined`
|
|
182
|
+
+ ` (the copy answered it "FROM_COPY")`,
|
|
183
|
+
)
|
|
184
|
+
record(
|
|
185
|
+
'editing a COPIED response does not write a built-in profile field (gender)',
|
|
186
|
+
!afterCopyEdit.gender,
|
|
187
|
+
`patient B gender=${JSON.stringify(afterCopyEdit.gender)}, expected empty (the copy answered "Female")`,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
/* ===== 4. everything other than the profile-field sync is unchanged on a copy ===== */
|
|
191
|
+
const savedCopy = await poll_until(
|
|
192
|
+
() => sdk.api.form_responses.getOne(copy.id),
|
|
193
|
+
(r: FormResponse) => (r.scores ?? []).some(s => s.title === 'Total' && s.value === 7),
|
|
194
|
+
)
|
|
195
|
+
record(
|
|
196
|
+
'editing a copy still saves its own responses',
|
|
197
|
+
savedCopy.responses?.find(r => r.fieldId === copyField.id)?.answer?.value === 'FROM_COPY',
|
|
198
|
+
`copy responses: ${JSON.stringify(savedCopy.responses?.map(r => r.answer?.value))}, expected to include "FROM_COPY"`,
|
|
199
|
+
)
|
|
200
|
+
record(
|
|
201
|
+
'editing a copy still recalculates its scores',
|
|
202
|
+
(savedCopy.scores ?? []).some(s => s.title === 'Total' && s.value === 7),
|
|
203
|
+
`copy scores: ${JSON.stringify(savedCopy.scores)}, expected Total=7`,
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
/* ===== 5. an enduser may not stamp copiedFrom on their own response ===== */
|
|
207
|
+
// copiedFrom is now a control field: it decides whether the intake sync runs at all. Endusers may
|
|
208
|
+
// update their own in-progress response (form_responses.enduserActions.update, for partial
|
|
209
|
+
// saves), so the schema marks both copy fields enduserUpdatesDisabled — otherwise a portal
|
|
210
|
+
// patient could suppress the sync of everything they answer, or point the staff-facing "View
|
|
211
|
+
// original patient" link at an arbitrary patient id.
|
|
212
|
+
{
|
|
213
|
+
const { response: portalResponse } = await sdk.api.form_responses.prepare_form_response({
|
|
214
|
+
formId: form.id,
|
|
215
|
+
enduserId: patientB.id,
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
const enduserSDK = new EnduserSession({ host, businessId: tenant.businessId })
|
|
219
|
+
const { authToken, enduser } = await sdk.api.endusers.generate_auth_token({ id: patientB.id })
|
|
220
|
+
await enduserSDK.handle_new_session({ authToken, enduser })
|
|
221
|
+
|
|
222
|
+
// control: the enduser session CAN update its own response (so a rejection below is about the
|
|
223
|
+
// field, not about access). A partial answer save is the enduserActions.update use case; the
|
|
224
|
+
// score field carries no intakeField, so this control writes no profile field of its own.
|
|
225
|
+
let selfUpdateWorked = false
|
|
226
|
+
let selfUpdateError: any
|
|
227
|
+
try {
|
|
228
|
+
await enduserSDK.api.form_responses.updateOne(portalResponse.id, {
|
|
229
|
+
responses: [answer(scoreField.id, 'Score Me', 3)],
|
|
230
|
+
}, { replaceObjectFields: true })
|
|
231
|
+
selfUpdateWorked = true
|
|
232
|
+
} catch (err: any) { selfUpdateError = err }
|
|
233
|
+
|
|
234
|
+
let copiedFromError: any
|
|
235
|
+
try {
|
|
236
|
+
await enduserSDK.api.form_responses.updateOne(portalResponse.id, { copiedFrom: original.id })
|
|
237
|
+
} catch (err: any) {
|
|
238
|
+
copiedFromError = err
|
|
239
|
+
}
|
|
240
|
+
let copiedFromEnduserIdError: any
|
|
241
|
+
try {
|
|
242
|
+
await enduserSDK.api.form_responses.updateOne(portalResponse.id, { copiedFromEnduserId: patientA.id })
|
|
243
|
+
} catch (err: any) {
|
|
244
|
+
copiedFromEnduserIdError = err
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
record(
|
|
248
|
+
'control: an enduser session can update an ordinary field on its own response',
|
|
249
|
+
selfUpdateWorked,
|
|
250
|
+
`self-update of the response's own answers ${selfUpdateWorked ? 'succeeded' : `failed: ${JSON.stringify(selfUpdateError?.message ?? selfUpdateError ?? null)}`}`
|
|
251
|
+
+ ' (if this fails, the two rejections below prove nothing about the field lock)',
|
|
252
|
+
)
|
|
253
|
+
record(
|
|
254
|
+
'an enduser cannot set copiedFrom on their own response',
|
|
255
|
+
/cannot be updated by endusers/.test(copiedFromError?.message ?? ''),
|
|
256
|
+
`error=${JSON.stringify(copiedFromError?.message ?? copiedFromError ?? null)}`
|
|
257
|
+
+ ` (status ${copiedFromError?.status ?? copiedFromError?.code ?? 'unknown'});`
|
|
258
|
+
+ ` expected a rejection naming the field`,
|
|
259
|
+
)
|
|
260
|
+
record(
|
|
261
|
+
'an enduser cannot set copiedFromEnduserId on their own response',
|
|
262
|
+
/cannot be updated by endusers/.test(copiedFromEnduserIdError?.message ?? ''),
|
|
263
|
+
`error=${JSON.stringify(copiedFromEnduserIdError?.message ?? copiedFromEnduserIdError ?? null)}`
|
|
264
|
+
+ ` (status ${copiedFromEnduserIdError?.status ?? copiedFromEnduserIdError?.code ?? 'unknown'});`
|
|
265
|
+
+ ` expected a rejection naming the field`,
|
|
266
|
+
)
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* ===== 6. the source patient is untouched by the edit made on the copy ===== */
|
|
270
|
+
const sourceAfter = await readA()
|
|
271
|
+
record(
|
|
272
|
+
'editing the copy leaves the SOURCE patient\'s fields as the original submission left them',
|
|
273
|
+
sourceAfter.gender === 'Male' && sourceAfter.fields?.[COPY_KEY] === 'FROM_A',
|
|
274
|
+
`patient A: gender=${JSON.stringify(sourceAfter.gender)},`
|
|
275
|
+
+ ` fields.${COPY_KEY}=${JSON.stringify(sourceAfter.fields?.[COPY_KEY])}; expected "Male" / "FROM_A"`,
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
return checks
|
|
279
|
+
} finally {
|
|
280
|
+
await tenant?.teardown()
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Asserting wrapper, for standalone runs. */
|
|
285
|
+
export const copied_form_response_no_enduser_sync_tests = async () => {
|
|
286
|
+
assert_checks('Copied form response does not sync enduser fields', await copied_form_response_no_enduser_sync_checks())
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
290
|
+
export const ISOLATED_SUITE: IsolatedSuite = {
|
|
291
|
+
name: 'Copied form response does not sync enduser fields',
|
|
292
|
+
run: copied_form_response_no_enduser_sync_checks,
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Allow running this test file independently
|
|
296
|
+
if (require.main === module) {
|
|
297
|
+
console.log(`Using API URL: ${host}`)
|
|
298
|
+
copied_form_response_no_enduser_sync_tests()
|
|
299
|
+
.then(() => {
|
|
300
|
+
console.log("Copied form response enduser sync test suite completed successfully")
|
|
301
|
+
process.exit(0)
|
|
302
|
+
})
|
|
303
|
+
.catch((error) => {
|
|
304
|
+
console.error("Copied form response enduser sync test suite failed:", error)
|
|
305
|
+
process.exit(1)
|
|
306
|
+
})
|
|
307
|
+
}
|