@tellescope/sdk 2.0.0-beta.1 → 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/CLAUDE.md +24 -0
- package/env.example +6 -0
- package/lib/cjs/sdk.d.ts +375 -4
- 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/booking_prevent_upcoming_duplicate.test.d.ts +22 -0
- package/lib/cjs/tests/api_tests/booking_prevent_upcoming_duplicate.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/booking_prevent_upcoming_duplicate.test.js +506 -0
- package/lib/cjs/tests/api_tests/booking_prevent_upcoming_duplicate.test.js.map +1 -0
- 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/enduser_fields_sync.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/enduser_fields_sync.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/enduser_fields_sync.test.js +3 -1
- package/lib/cjs/tests/api_tests/enduser_fields_sync.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.js +3 -1
- package/lib/cjs/tests/api_tests/enduser_observations_auto_review.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/form_vital_reading.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/form_vital_reading.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/form_vital_reading.test.js +461 -0
- package/lib/cjs/tests/api_tests/form_vital_reading.test.js.map +1 -0
- 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/journey_statistics_cache.test.d.ts +26 -0
- package/lib/cjs/tests/api_tests/journey_statistics_cache.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/journey_statistics_cache.test.js +232 -0
- package/lib/cjs/tests/api_tests/journey_statistics_cache.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/journey_step_manual_count.test.d.ts +34 -0
- package/lib/cjs/tests/api_tests/journey_step_manual_count.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/journey_step_manual_count.test.js +243 -0
- package/lib/cjs/tests/api_tests/journey_step_manual_count.test.js.map +1 -0
- 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 +9 -1
- 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 +118 -32
- 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 +3 -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 +221 -52
- 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_embed_leave_message.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/phone_embed_leave_message.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/phone_embed_leave_message.test.js +571 -0
- package/lib/cjs/tests/api_tests/phone_embed_leave_message.test.js.map +1 -0
- 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 +3 -1
- package/lib/cjs/tests/api_tests/programs.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/programs.test.js +474 -51
- package/lib/cjs/tests/api_tests/programs.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/public_form_case_insensitive_match.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/public_form_case_insensitive_match.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/public_form_case_insensitive_match.test.js +733 -0
- package/lib/cjs/tests/api_tests/public_form_case_insensitive_match.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.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/appointment-reschedule-ownership.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/appointment-reschedule-ownership.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/appointment-reschedule-ownership.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/appointment-reschedule-ownership.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/file-link-session-confinement.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/file-link-session-confinement.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/file-link-session-confinement.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/file-link-session-confinement.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/formsort_webhook_auth_field_lock.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/formsort_webhook_auth_field_lock.test.js +424 -39
- package/lib/cjs/tests/api_tests/security/formsort_webhook_auth_field_lock.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/rich-text-answer-sanitized-on-write.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.js +3 -1
- package/lib/cjs/tests/api_tests/security/rich-text-answer-sanitized-on-write.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/session_for_join_link.test.d.ts +10 -0
- package/lib/cjs/tests/api_tests/session_for_join_link.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/session_for_join_link.test.js +147 -0
- package/lib/cjs/tests/api_tests/session_for_join_link.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/set_fields_order_templates.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/set_fields_order_templates.test.js +191 -88
- package/lib/cjs/tests/api_tests/set_fields_order_templates.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/stripe_checkout_items.test.d.ts +17 -0
- package/lib/cjs/tests/api_tests/stripe_checkout_items.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/stripe_checkout_items.test.js +219 -0
- package/lib/cjs/tests/api_tests/stripe_checkout_items.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/stripe_multiple_customer_ids.test.d.ts +5 -0
- package/lib/cjs/tests/api_tests/stripe_multiple_customer_ids.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/stripe_multiple_customer_ids.test.js +396 -0
- package/lib/cjs/tests/api_tests/stripe_multiple_customer_ids.test.js.map +1 -0
- 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/tickets_bulk_assign_from_queue.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.js +3 -1
- package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/totp_mfa.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/totp_mfa.test.js +37 -31
- package/lib/cjs/tests/api_tests/totp_mfa.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_contains_matching.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/trigger_contains_matching.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/trigger_contains_matching.test.js +3 -1
- package/lib/cjs/tests/api_tests/trigger_contains_matching.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_logs_restore_deleted.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/user_logs_restore_deleted.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/user_logs_restore_deleted.test.js +3 -1
- package/lib/cjs/tests/api_tests/user_logs_restore_deleted.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/vital_review_trigger_action.test.d.ts +3 -1
- package/lib/cjs/tests/api_tests/vital_review_trigger_action.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/vital_review_trigger_action.test.js +3 -1
- package/lib/cjs/tests/api_tests/vital_review_trigger_action.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/vitl_push.test.d.ts +7 -0
- package/lib/cjs/tests/api_tests/vitl_push.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/vitl_push.test.js +341 -0
- package/lib/cjs/tests/api_tests/vitl_push.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 +55 -0
- package/lib/cjs/tests/setup_isolated.d.ts.map +1 -1
- package/lib/cjs/tests/setup_isolated.js +119 -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 +385 -535
- 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/tests/unit_tests/isolated_suite_discovery.test.d.ts +2 -0
- package/lib/cjs/tests/unit_tests/isolated_suite_discovery.test.d.ts.map +1 -0
- package/lib/cjs/tests/unit_tests/isolated_suite_discovery.test.js +201 -0
- package/lib/cjs/tests/unit_tests/isolated_suite_discovery.test.js.map +1 -0
- package/lib/cjs/tests/unit_tests/programs_conditional_logic.test.d.ts +3 -0
- package/lib/cjs/tests/unit_tests/programs_conditional_logic.test.d.ts.map +1 -0
- package/lib/cjs/tests/unit_tests/programs_conditional_logic.test.js +120 -0
- package/lib/cjs/tests/unit_tests/programs_conditional_logic.test.js.map +1 -0
- package/lib/cjs/tests/webhooks_tests.js +44 -34
- package/lib/cjs/tests/webhooks_tests.js.map +1 -1
- package/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/lib/esm/sdk.d.ts +375 -4
- 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/booking_prevent_upcoming_duplicate.test.d.ts +22 -0
- package/lib/esm/tests/api_tests/booking_prevent_upcoming_duplicate.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/booking_prevent_upcoming_duplicate.test.js +501 -0
- package/lib/esm/tests/api_tests/booking_prevent_upcoming_duplicate.test.js.map +1 -0
- 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/enduser_fields_sync.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/enduser_fields_sync.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/enduser_fields_sync.test.js +2 -0
- package/lib/esm/tests/api_tests/enduser_fields_sync.test.js.map +1 -1
- package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.js +2 -0
- package/lib/esm/tests/api_tests/enduser_observations_auto_review.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/form_vital_reading.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/form_vital_reading.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/form_vital_reading.test.js +456 -0
- package/lib/esm/tests/api_tests/form_vital_reading.test.js.map +1 -0
- 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/journey_statistics_cache.test.d.ts +26 -0
- package/lib/esm/tests/api_tests/journey_statistics_cache.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/journey_statistics_cache.test.js +227 -0
- package/lib/esm/tests/api_tests/journey_statistics_cache.test.js.map +1 -0
- package/lib/esm/tests/api_tests/journey_step_manual_count.test.d.ts +34 -0
- package/lib/esm/tests/api_tests/journey_step_manual_count.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/journey_step_manual_count.test.js +238 -0
- package/lib/esm/tests/api_tests/journey_step_manual_count.test.js.map +1 -0
- 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 +9 -1
- 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 +117 -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 +3 -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 +220 -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_embed_leave_message.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/phone_embed_leave_message.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/phone_embed_leave_message.test.js +566 -0
- package/lib/esm/tests/api_tests/phone_embed_leave_message.test.js.map +1 -0
- 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 +3 -1
- package/lib/esm/tests/api_tests/programs.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/programs.test.js +473 -50
- package/lib/esm/tests/api_tests/programs.test.js.map +1 -1
- package/lib/esm/tests/api_tests/public_form_case_insensitive_match.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/public_form_case_insensitive_match.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/public_form_case_insensitive_match.test.js +728 -0
- package/lib/esm/tests/api_tests/public_form_case_insensitive_match.test.js.map +1 -0
- package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js +2 -0
- package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.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/appointment-reschedule-ownership.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/appointment-reschedule-ownership.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/appointment-reschedule-ownership.test.js +2 -0
- package/lib/esm/tests/api_tests/security/appointment-reschedule-ownership.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/file-link-session-confinement.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/file-link-session-confinement.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/file-link-session-confinement.test.js +2 -0
- package/lib/esm/tests/api_tests/security/file-link-session-confinement.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.js +2 -0
- package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/formsort_webhook_auth_field_lock.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/formsort_webhook_auth_field_lock.test.js +424 -39
- package/lib/esm/tests/api_tests/security/formsort_webhook_auth_field_lock.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/rich-text-answer-sanitized-on-write.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.js +2 -0
- package/lib/esm/tests/api_tests/security/rich-text-answer-sanitized-on-write.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/session_for_join_link.test.d.ts +10 -0
- package/lib/esm/tests/api_tests/session_for_join_link.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/session_for_join_link.test.js +142 -0
- package/lib/esm/tests/api_tests/session_for_join_link.test.js.map +1 -0
- package/lib/esm/tests/api_tests/set_fields_order_templates.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/set_fields_order_templates.test.js +191 -88
- package/lib/esm/tests/api_tests/set_fields_order_templates.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/stripe_checkout_items.test.d.ts +17 -0
- package/lib/esm/tests/api_tests/stripe_checkout_items.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/stripe_checkout_items.test.js +214 -0
- package/lib/esm/tests/api_tests/stripe_checkout_items.test.js.map +1 -0
- package/lib/esm/tests/api_tests/stripe_multiple_customer_ids.test.d.ts +5 -0
- package/lib/esm/tests/api_tests/stripe_multiple_customer_ids.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/stripe_multiple_customer_ids.test.js +388 -0
- package/lib/esm/tests/api_tests/stripe_multiple_customer_ids.test.js.map +1 -0
- 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/tickets_bulk_assign_from_queue.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.js +2 -0
- package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.js.map +1 -1
- package/lib/esm/tests/api_tests/totp_mfa.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/totp_mfa.test.js +37 -31
- package/lib/esm/tests/api_tests/totp_mfa.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_contains_matching.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/trigger_contains_matching.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/trigger_contains_matching.test.js +2 -0
- package/lib/esm/tests/api_tests/trigger_contains_matching.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_logs_restore_deleted.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/user_logs_restore_deleted.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/user_logs_restore_deleted.test.js +2 -0
- package/lib/esm/tests/api_tests/user_logs_restore_deleted.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/vital_review_trigger_action.test.d.ts +3 -1
- package/lib/esm/tests/api_tests/vital_review_trigger_action.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/vital_review_trigger_action.test.js +2 -0
- package/lib/esm/tests/api_tests/vital_review_trigger_action.test.js.map +1 -1
- package/lib/esm/tests/api_tests/vitl_push.test.d.ts +7 -0
- package/lib/esm/tests/api_tests/vitl_push.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/vitl_push.test.js +333 -0
- package/lib/esm/tests/api_tests/vitl_push.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 +55 -0
- package/lib/esm/tests/setup_isolated.d.ts.map +1 -1
- package/lib/esm/tests/setup_isolated.js +114 -0
- 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 +386 -536
- 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/esm/tests/unit_tests/isolated_suite_discovery.test.d.ts +2 -0
- package/lib/esm/tests/unit_tests/isolated_suite_discovery.test.d.ts.map +1 -0
- package/lib/esm/tests/unit_tests/isolated_suite_discovery.test.js +174 -0
- package/lib/esm/tests/unit_tests/isolated_suite_discovery.test.js.map +1 -0
- package/lib/esm/tests/unit_tests/programs_conditional_logic.test.d.ts +3 -0
- package/lib/esm/tests/unit_tests/programs_conditional_logic.test.d.ts.map +1 -0
- package/lib/esm/tests/unit_tests/programs_conditional_logic.test.js +117 -0
- package/lib/esm/tests/unit_tests/programs_conditional_logic.test.js.map +1 -0
- package/lib/esm/tests/webhooks_tests.js +44 -34
- package/lib/esm/tests/webhooks_tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -11
- package/src/sdk.ts +14 -2
- 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/booking_prevent_upcoming_duplicate.test.ts +541 -0
- 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/enduser_fields_sync.test.ts +4 -0
- package/src/tests/api_tests/enduser_observations_auto_review.test.ts +4 -0
- 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/form_vital_reading.test.ts +393 -0
- 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/journey_statistics_cache.test.ts +237 -0
- package/src/tests/api_tests/journey_step_manual_count.test.ts +220 -0
- 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 +107 -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 +174 -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_embed_leave_message.test.ts +541 -0
- package/src/tests/api_tests/phone_tree_enduser_condition.test.ts +81 -32
- package/src/tests/api_tests/programs.test.ts +701 -0
- package/src/tests/api_tests/public_form_case_insensitive_match.test.ts +632 -0
- package/src/tests/api_tests/security/add-to-journey-foreign-enduserid.test.ts +4 -0
- package/src/tests/api_tests/security/ai-conversations-rbac.test.ts +248 -128
- package/src/tests/api_tests/security/appointment-reschedule-ownership.test.ts +4 -0
- 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/file-link-session-confinement.test.ts +4 -0
- package/src/tests/api_tests/security/form-logic-js-execution.test.ts +4 -0
- package/src/tests/api_tests/security/formsort_webhook_auth_field_lock.test.ts +225 -0
- 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/rich-text-answer-sanitized-on-write.test.ts +4 -0
- 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/session_for_join_link.test.ts +99 -0
- package/src/tests/api_tests/set_fields_order_templates.test.ts +94 -9
- package/src/tests/api_tests/stedi_approval.test.ts +156 -90
- package/src/tests/api_tests/stripe_checkout_items.test.ts +186 -0
- 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/tickets_bulk_assign_from_queue.test.ts +4 -0
- package/src/tests/api_tests/totp_mfa.test.ts +10 -5
- package/src/tests/api_tests/translations.test.ts +69 -46
- package/src/tests/api_tests/trigger_contains_matching.test.ts +4 -0
- package/src/tests/api_tests/trigger_set_fields_date_difference.test.ts +198 -256
- package/src/tests/api_tests/user_logs_restore_deleted.test.ts +4 -0
- package/src/tests/api_tests/user_preferences.test.ts +227 -0
- package/src/tests/api_tests/vital_review_trigger_action.test.ts +455 -0
- package/src/tests/api_tests/vitl_push.test.ts +323 -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 +147 -0
- package/src/tests/tests.ts +165 -177
- package/src/tests/{api_tests → unit_tests}/date_string_validation.test.ts +2 -23
- package/src/tests/unit_tests/isolated_suite_discovery.test.ts +178 -0
- package/src/tests/unit_tests/programs_conditional_logic.test.ts +189 -0
- package/src/tests/webhooks_tests.ts +6 -1
- package/test_generated.pdf +0 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ISOLATED_SUITE = exports.stripe_checkout_items_tests = exports.stripe_checkout_items_checks = void 0;
|
|
40
|
+
require('source-map-support').install();
|
|
41
|
+
var setup_isolated_1 = require("../setup_isolated");
|
|
42
|
+
var setup_1 = require("../setup");
|
|
43
|
+
var sdk_1 = require("../../sdk");
|
|
44
|
+
var host = process.env.API_URL || 'http://localhost:8080';
|
|
45
|
+
var RAND = function () { return Math.random().toString(36).slice(2, 10); };
|
|
46
|
+
var ENDUSER_RAW_IDS_MESSAGE = "stripePriceId and subscriptionPriceId are not supported for enduser sessions";
|
|
47
|
+
var QUANTITY_MESSAGE = "quantity must be a whole number of at least 1";
|
|
48
|
+
var EXACTLY_ONE_ID_MESSAGE = "Each items entry must specify exactly one of productId, stripePriceId, or subscriptionPriceId";
|
|
49
|
+
// what the handler throws once a request is past every items guard and no Stripe account is
|
|
50
|
+
// configured - the marker for "this cart was accepted, it only ran out of Stripe"
|
|
51
|
+
var NO_STRIPE_MESSAGE = "Stripe Connection not found";
|
|
52
|
+
/**
|
|
53
|
+
* The guards on the `items` parameter of products/prepare-stripe-checkout that run BEFORE any Stripe
|
|
54
|
+
* integration is resolved, so they are reachable without a Stripe account: the enduser rejection of
|
|
55
|
+
* raw Stripe price ids, the productIds/items exclusivity, the per-entry shape rules and the quantity
|
|
56
|
+
* validator.
|
|
57
|
+
*
|
|
58
|
+
* The quantity guards themselves (the cap of 99, the two "greater than 1" rejections) sit on the
|
|
59
|
+
* Stripe Custom branch and are pinned instead by the unit suite in
|
|
60
|
+
* packages/private/api/api/integrations/payments/stripe_line_items.test.ts, which needs no database
|
|
61
|
+
* and no Stripe account. Anything that creates or inspects a real Checkout session is manual QA.
|
|
62
|
+
*/
|
|
63
|
+
var stripe_checkout_items_checks = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
64
|
+
var checks, record, tenant, sdk_2, businessId, product, enduser, enduserSDK_1, errorFor, enduserRawPrice, enduserRawSubscription, enduserProduct, userRawPrice, both, neither, noId, twoIds, unknownId, unknown, _i, _a, quantity, message, productIdsOnly, e_1;
|
|
65
|
+
return __generator(this, function (_b) {
|
|
66
|
+
switch (_b.label) {
|
|
67
|
+
case 0:
|
|
68
|
+
checks = [];
|
|
69
|
+
record = function (label, pass, detail) { return checks.push({ label: label, pass: pass, detail: detail }); };
|
|
70
|
+
_b.label = 1;
|
|
71
|
+
case 1:
|
|
72
|
+
_b.trys.push([1, , 20, 25]);
|
|
73
|
+
return [4 /*yield*/, (0, setup_isolated_1.setup_isolated_tenant)({
|
|
74
|
+
name: "stripe items ".concat(RAND()),
|
|
75
|
+
users: [{ isAdmin: true }],
|
|
76
|
+
apiKeys: 0,
|
|
77
|
+
})];
|
|
78
|
+
case 2:
|
|
79
|
+
tenant = _b.sent();
|
|
80
|
+
sdk_2 = tenant.sdk, businessId = tenant.businessId;
|
|
81
|
+
return [4 /*yield*/, sdk_2.api.products.createOne({
|
|
82
|
+
title: "Checkout Item Product ".concat(RAND()),
|
|
83
|
+
cost: { amount: 500, currency: 'USD' },
|
|
84
|
+
processor: 'Stripe',
|
|
85
|
+
})];
|
|
86
|
+
case 3:
|
|
87
|
+
product = _b.sent();
|
|
88
|
+
return [4 /*yield*/, sdk_2.api.endusers.createOne({ email: "items_".concat(RAND(), "@test.tellescope.com") })];
|
|
89
|
+
case 4:
|
|
90
|
+
enduser = _b.sent();
|
|
91
|
+
enduserSDK_1 = new sdk_1.EnduserSession({ host: host, businessId: businessId });
|
|
92
|
+
return [4 /*yield*/, (0, setup_1.authenticate_enduser_via_token)(sdk_2, enduserSDK_1, { id: enduser.id })
|
|
93
|
+
// returns the error message for a rejected request, or '' when the request succeeded
|
|
94
|
+
];
|
|
95
|
+
case 5:
|
|
96
|
+
_b.sent();
|
|
97
|
+
errorFor = function (session, args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
98
|
+
var err_1;
|
|
99
|
+
var _a;
|
|
100
|
+
return __generator(this, function (_b) {
|
|
101
|
+
switch (_b.label) {
|
|
102
|
+
case 0:
|
|
103
|
+
_b.trys.push([0, 2, , 3]);
|
|
104
|
+
return [4 /*yield*/, session.api.products.prepare_stripe_checkout(args)];
|
|
105
|
+
case 1:
|
|
106
|
+
_b.sent();
|
|
107
|
+
return [2 /*return*/, ''];
|
|
108
|
+
case 2:
|
|
109
|
+
err_1 = _b.sent();
|
|
110
|
+
return [2 /*return*/, typeof err_1 === 'string' ? err_1 : ((_a = err_1 === null || err_1 === void 0 ? void 0 : err_1.message) !== null && _a !== void 0 ? _a : JSON.stringify(err_1))];
|
|
111
|
+
case 3: return [2 /*return*/];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}); };
|
|
115
|
+
return [4 /*yield*/, errorFor(enduserSDK_1, { items: [{ stripePriceId: 'price_raw', quantity: 1 }] })];
|
|
116
|
+
case 6:
|
|
117
|
+
enduserRawPrice = _b.sent();
|
|
118
|
+
record('an enduser naming a raw stripePriceId is rejected', enduserRawPrice === ENDUSER_RAW_IDS_MESSAGE, "expected \"".concat(ENDUSER_RAW_IDS_MESSAGE, "\", got \"").concat(enduserRawPrice, "\""));
|
|
119
|
+
return [4 /*yield*/, errorFor(enduserSDK_1, { items: [{ subscriptionPriceId: 'price_sub', quantity: 1 }] })];
|
|
120
|
+
case 7:
|
|
121
|
+
enduserRawSubscription = _b.sent();
|
|
122
|
+
record('an enduser naming a raw subscriptionPriceId is rejected', enduserRawSubscription === ENDUSER_RAW_IDS_MESSAGE, "expected \"".concat(ENDUSER_RAW_IDS_MESSAGE, "\", got \"").concat(enduserRawSubscription, "\""));
|
|
123
|
+
return [4 /*yield*/, errorFor(enduserSDK_1, { items: [{ productId: product.id, quantity: 2 }] })];
|
|
124
|
+
case 8:
|
|
125
|
+
enduserProduct = _b.sent();
|
|
126
|
+
record('an enduser naming a Tellescope productId is allowed through the guard', enduserProduct === NO_STRIPE_MESSAGE, "expected \"".concat(NO_STRIPE_MESSAGE, "\", got \"").concat(enduserProduct, "\""));
|
|
127
|
+
return [4 /*yield*/, errorFor(sdk_2, { items: [{ stripePriceId: 'price_raw', quantity: 1 }] })];
|
|
128
|
+
case 9:
|
|
129
|
+
userRawPrice = _b.sent();
|
|
130
|
+
record('a user session naming a raw stripePriceId is allowed through the guard', userRawPrice === NO_STRIPE_MESSAGE, "expected \"".concat(NO_STRIPE_MESSAGE, "\", got \"").concat(userRawPrice, "\""));
|
|
131
|
+
return [4 /*yield*/, errorFor(sdk_2, { productIds: [product.id], items: [{ productId: product.id, quantity: 1 }] })];
|
|
132
|
+
case 10:
|
|
133
|
+
both = _b.sent();
|
|
134
|
+
record('passing both productIds and items is rejected', both === "Pass either productIds or items, not both", "expected the \"not both\" message, got \"".concat(both, "\""));
|
|
135
|
+
return [4 /*yield*/, errorFor(sdk_2, {})];
|
|
136
|
+
case 11:
|
|
137
|
+
neither = _b.sent();
|
|
138
|
+
record('passing neither productIds nor items is rejected', neither === "One of productIds or items is required", "expected the \"one of\" message, got \"".concat(neither, "\""));
|
|
139
|
+
return [4 /*yield*/, errorFor(sdk_2, { items: [{ quantity: 1 }] })];
|
|
140
|
+
case 12:
|
|
141
|
+
noId = _b.sent();
|
|
142
|
+
record('an items entry naming no id is rejected', noId === EXACTLY_ONE_ID_MESSAGE, "expected the \"exactly one\" message, got \"".concat(noId, "\""));
|
|
143
|
+
return [4 /*yield*/, errorFor(sdk_2, { items: [{ productId: product.id, stripePriceId: 'price_raw', quantity: 1 }] })];
|
|
144
|
+
case 13:
|
|
145
|
+
twoIds = _b.sent();
|
|
146
|
+
record('an items entry naming two ids is rejected', twoIds === EXACTLY_ONE_ID_MESSAGE, "expected the \"exactly one\" message, got \"".concat(twoIds, "\""));
|
|
147
|
+
unknownId = '60398b0231a295e64f084fd9';
|
|
148
|
+
return [4 /*yield*/, errorFor(sdk_2, { items: [{ productId: unknownId, quantity: 1 }] })];
|
|
149
|
+
case 14:
|
|
150
|
+
unknown = _b.sent();
|
|
151
|
+
record('an items entry naming an unknown productId is rejected, naming the id', unknown.includes(unknownId) && unknown.includes('No product found'), "expected a \"No product found for productId ".concat(unknownId, "\", got \"").concat(unknown, "\""));
|
|
152
|
+
_i = 0, _a = [0, -1, 1.5];
|
|
153
|
+
_b.label = 15;
|
|
154
|
+
case 15:
|
|
155
|
+
if (!(_i < _a.length)) return [3 /*break*/, 18];
|
|
156
|
+
quantity = _a[_i];
|
|
157
|
+
return [4 /*yield*/, errorFor(sdk_2, { items: [{ productId: product.id, quantity: quantity }] })];
|
|
158
|
+
case 16:
|
|
159
|
+
message = _b.sent();
|
|
160
|
+
record("quantity ".concat(quantity, " is rejected"), message.includes(QUANTITY_MESSAGE), "expected a message containing \"".concat(QUANTITY_MESSAGE, "\", got \"").concat(message, "\""));
|
|
161
|
+
_b.label = 17;
|
|
162
|
+
case 17:
|
|
163
|
+
_i++;
|
|
164
|
+
return [3 /*break*/, 15];
|
|
165
|
+
case 18: return [4 /*yield*/, errorFor(sdk_2, { productIds: [product.id] })];
|
|
166
|
+
case 19:
|
|
167
|
+
productIdsOnly = _b.sent();
|
|
168
|
+
record('a productIds-only request is unaffected', productIdsOnly === NO_STRIPE_MESSAGE, "expected \"".concat(NO_STRIPE_MESSAGE, "\", got \"").concat(productIdsOnly, "\""));
|
|
169
|
+
return [3 /*break*/, 25];
|
|
170
|
+
case 20:
|
|
171
|
+
if (!tenant) return [3 /*break*/, 24];
|
|
172
|
+
_b.label = 21;
|
|
173
|
+
case 21:
|
|
174
|
+
_b.trys.push([21, 23, , 24]);
|
|
175
|
+
return [4 /*yield*/, tenant.teardown()];
|
|
176
|
+
case 22:
|
|
177
|
+
_b.sent();
|
|
178
|
+
return [3 /*break*/, 24];
|
|
179
|
+
case 23:
|
|
180
|
+
e_1 = _b.sent();
|
|
181
|
+
console.error('teardown failed', e_1);
|
|
182
|
+
return [3 /*break*/, 24];
|
|
183
|
+
case 24: return [7 /*endfinally*/];
|
|
184
|
+
case 25: return [2 /*return*/, checks];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}); };
|
|
188
|
+
exports.stripe_checkout_items_checks = stripe_checkout_items_checks;
|
|
189
|
+
var stripe_checkout_items_tests = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
190
|
+
var _a, _b;
|
|
191
|
+
return __generator(this, function (_c) {
|
|
192
|
+
switch (_c.label) {
|
|
193
|
+
case 0:
|
|
194
|
+
_a = setup_isolated_1.assert_checks;
|
|
195
|
+
_b = ['prepare_stripe_checkout items guards'];
|
|
196
|
+
return [4 /*yield*/, (0, exports.stripe_checkout_items_checks)()];
|
|
197
|
+
case 1:
|
|
198
|
+
_a.apply(void 0, _b.concat([_c.sent()]));
|
|
199
|
+
return [2 /*return*/];
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}); };
|
|
203
|
+
exports.stripe_checkout_items_tests = stripe_checkout_items_tests;
|
|
204
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
205
|
+
exports.ISOLATED_SUITE = { name: 'prepare_stripe_checkout items guards', run: exports.stripe_checkout_items_checks };
|
|
206
|
+
// Allow running this test file independently
|
|
207
|
+
if (require.main === module) {
|
|
208
|
+
console.log("\uD83C\uDF10 Using API URL: ".concat(host));
|
|
209
|
+
(0, exports.stripe_checkout_items_tests)()
|
|
210
|
+
.then(function () {
|
|
211
|
+
console.log("✅ stripe_checkout_items test suite completed successfully");
|
|
212
|
+
process.exit(0);
|
|
213
|
+
})
|
|
214
|
+
.catch(function (error) {
|
|
215
|
+
console.error("❌ stripe_checkout_items test suite failed:", error);
|
|
216
|
+
process.exit(1);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=stripe_checkout_items.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe_checkout_items.test.js","sourceRoot":"","sources":["../../../../src/tests/api_tests/stripe_checkout_items.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE,CAAC;AAExC,oDAK0B;AAC1B,kCAAyD;AACzD,iCAA0C;AAE1C,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,uBAAgC,CAAA;AAEpE,IAAM,IAAI,GAAG,cAAM,OAAA,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAvC,CAAuC,CAAA;AAE1D,IAAM,uBAAuB,GAAG,8EAA8E,CAAA;AAC9G,IAAM,gBAAgB,GAAG,+CAA+C,CAAA;AACxE,IAAM,sBAAsB,GAAG,+FAA+F,CAAA;AAC9H,4FAA4F;AAC5F,kFAAkF;AAClF,IAAM,iBAAiB,GAAG,6BAA6B,CAAA;AAEvD;;;;;;;;;;GAUG;AACI,IAAM,4BAA4B,GAAG;;;;;gBACpC,MAAM,GAAY,EAAE,CAAA;gBACpB,MAAM,GAAG,UAAC,KAAa,EAAE,IAAa,EAAE,MAAc,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,OAAA,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC,EAApC,CAAoC,CAAA;;;;gBAK1F,qBAAM,IAAA,sCAAqB,EAAC;wBACnC,IAAI,EAAE,uBAAgB,IAAI,EAAE,CAAE;wBAC9B,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wBAC1B,OAAO,EAAE,CAAC;qBACX,CAAC,EAAA;;gBAJF,MAAM,GAAG,SAIP,CAAA;gBACM,QAAoB,MAAM,IAAvB,EAAE,UAAU,GAAK,MAAM,WAAX,CAAW;gBAElB,qBAAM,KAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC;wBAC/C,KAAK,EAAE,gCAAyB,IAAI,EAAE,CAAE;wBACxC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE;wBACtC,SAAS,EAAE,QAAQ;qBACpB,CAAC,EAAA;;gBAJI,OAAO,GAAG,SAId;gBAEc,qBAAM,KAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,gBAAS,IAAI,EAAE,yBAAsB,EAAE,CAAC,EAAA;;gBAA5F,OAAO,GAAG,SAAkF;gBAC5F,eAAa,IAAI,oBAAc,CAAC,EAAE,IAAI,MAAA,EAAE,UAAU,YAAA,EAAE,CAAC,CAAA;gBAC3D,qBAAM,IAAA,sCAA8B,EAAC,KAAG,EAAE,YAAU,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;oBAEzE,qFAAqF;kBAFZ;;gBAAzE,SAAyE,CAAA;gBAGnE,QAAQ,GAAG,UAAO,OAAuC,EAAE,IAAS;;;;;;;gCAEtE,qBAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,uBAA+B,CAAC,IAAI,CAAC,EAAA;;gCAAjE,SAAiE,CAAA;gCACjE,sBAAO,EAAE,EAAA;;;gCAET,sBAAO,OAAO,KAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAG,CAAC,CAAC,CAAC,CAAC,MAAA,KAAG,aAAH,KAAG,uBAAH,KAAG,CAAE,OAAO,mCAAI,IAAI,CAAC,SAAS,CAAC,KAAG,CAAC,CAAC,EAAA;;;;qBAE/E,CAAA;gBAGuB,qBAAM,QAAQ,CAAC,YAAU,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAAtG,eAAe,GAAG,SAAoF;gBAC5G,MAAM,CACJ,mDAAmD,EACnD,eAAe,KAAK,uBAAuB,EAC3C,qBAAa,uBAAuB,uBAAW,eAAe,OAAG,CAClE,CAAA;gBAE8B,qBAAM,QAAQ,CAAC,YAAU,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,mBAAmB,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAAnH,sBAAsB,GAAG,SAA0F;gBACzH,MAAM,CACJ,yDAAyD,EACzD,sBAAsB,KAAK,uBAAuB,EAClD,qBAAa,uBAAuB,uBAAW,sBAAsB,OAAG,CACzE,CAAA;gBAIsB,qBAAM,QAAQ,CAAC,YAAU,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAAhG,cAAc,GAAG,SAA+E;gBACtG,MAAM,CACJ,uEAAuE,EACvE,cAAc,KAAK,iBAAiB,EACpC,qBAAa,iBAAiB,uBAAW,cAAc,OAAG,CAC3D,CAAA;gBAGoB,qBAAM,QAAQ,CAAC,KAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAA5F,YAAY,GAAG,SAA6E;gBAClG,MAAM,CACJ,wEAAwE,EACxE,YAAY,KAAK,iBAAiB,EAClC,qBAAa,iBAAiB,uBAAW,YAAY,OAAG,CACzD,CAAA;gBAGY,qBAAM,QAAQ,CAAC,KAAG,EAAE,EAAE,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAAzG,IAAI,GAAG,SAAkG;gBAC/G,MAAM,CACJ,+CAA+C,EAC/C,IAAI,KAAK,2CAA2C,EACpD,mDAAyC,IAAI,OAAG,CACjD,CAAA;gBAEe,qBAAM,QAAQ,CAAC,KAAG,EAAE,EAAE,CAAC,EAAA;;gBAAjC,OAAO,GAAG,SAAuB;gBACvC,MAAM,CACJ,kDAAkD,EAClD,OAAO,KAAK,wCAAwC,EACpD,iDAAuC,OAAO,OAAG,CAClD,CAAA;gBAGY,qBAAM,QAAQ,CAAC,KAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAAxD,IAAI,GAAG,SAAiD;gBAC9D,MAAM,CACJ,yCAAyC,EACzC,IAAI,KAAK,sBAAsB,EAC/B,sDAA4C,IAAI,OAAG,CACpD,CAAA;gBAEc,qBAAM,QAAQ,CAAC,KAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAA7G,MAAM,GAAG,SAAoG;gBACnH,MAAM,CACJ,2CAA2C,EAC3C,MAAM,KAAK,sBAAsB,EACjC,sDAA4C,MAAM,OAAG,CACtD,CAAA;gBAGK,SAAS,GAAG,0BAA0B,CAAA;gBAC5B,qBAAM,QAAQ,CAAC,KAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAAjF,OAAO,GAAG,SAAuE;gBACvF,MAAM,CACJ,uEAAuE,EACvE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EACnE,sDAA8C,SAAS,uBAAW,OAAO,OAAG,CAC7E,CAAA;sBAMkC,EAAZ,MAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;;;qBAAZ,CAAA,cAAY,CAAA;gBAAxB,QAAQ;gBACD,qBAAM,QAAQ,CAAC,KAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,UAAA,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAA/E,OAAO,GAAG,SAAqE;gBACrF,MAAM,CACJ,mBAAY,QAAQ,iBAAc,EAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAClC,0CAAkC,gBAAgB,uBAAW,OAAO,OAAG,CACxE,CAAA;;;gBANoB,IAAY,CAAA;;qBAUZ,qBAAM,QAAQ,CAAC,KAAG,EAAE,EAAE,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAA;;gBAAlE,cAAc,GAAG,SAAiD;gBACxE,MAAM,CACJ,yCAAyC,EACzC,cAAc,KAAK,iBAAiB,EACpC,qBAAa,iBAAiB,uBAAW,cAAc,OAAG,CAC3D,CAAA;;;qBAGG,MAAM,EAAN,yBAAM;;;;gBAAU,qBAAM,MAAM,CAAC,QAAQ,EAAE,EAAA;;gBAAvB,SAAuB,CAAA;;;;gBAAe,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAC,CAAC,CAAA;;;qBAG/F,sBAAO,MAAM,EAAA;;;KACd,CAAA;AAnIY,QAAA,4BAA4B,gCAmIxC;AAEM,IAAM,2BAA2B,GAAG;;;;;gBACzC,KAAA,8BAAa,CAAA;sBAAC,sCAAsC;gBAAE,qBAAM,IAAA,oCAA4B,GAAE,EAAA;;gBAA1F,4BAAsD,SAAoC,GAAC,CAAA;;;;KAC5F,CAAA;AAFY,QAAA,2BAA2B,+BAEvC;AAED,oGAAoG;AACvF,QAAA,cAAc,GAAkB,EAAE,IAAI,EAAE,sCAAsC,EAAE,GAAG,EAAE,oCAA4B,EAAE,CAAA;AAEhI,6CAA6C;AAC7C,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;IAC3B,OAAO,CAAC,GAAG,CAAC,sCAAqB,IAAI,CAAE,CAAC,CAAA;IACxC,IAAA,mCAA2B,GAAE;SAC1B,IAAI,CAAC;QACJ,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAA;QACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAC;SACD,KAAK,CAAC,UAAC,KAAK;QACX,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,KAAK,CAAC,CAAA;QAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAC,CAAA;CACL"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Check } from "../setup_isolated";
|
|
2
|
+
export declare const stripe_multiple_customer_ids_checks: () => Promise<Check[]>;
|
|
3
|
+
/** Asserting wrapper, for standalone runs and for sequential use in the suite. */
|
|
4
|
+
export declare const stripe_multiple_customer_ids_tests: () => Promise<void>;
|
|
5
|
+
//# sourceMappingURL=stripe_multiple_customer_ids.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe_multiple_customer_ids.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/api_tests/stripe_multiple_customer_ids.test.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,EAEN,MAAM,mBAAmB,CAAA;AAiD1B,eAAO,MAAM,mCAAmC,QAAa,QAAQ,KAAK,EAAE,CAuR3E,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,kCAAkC,qBAE9C,CAAA"}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.stripe_multiple_customer_ids_tests = exports.stripe_multiple_customer_ids_checks = void 0;
|
|
43
|
+
require('source-map-support').install();
|
|
44
|
+
var enduser_1 = require("../../enduser");
|
|
45
|
+
var setup_isolated_1 = require("../setup_isolated");
|
|
46
|
+
var stripe_webhook_helpers_1 = require("../stripe_webhook_helpers");
|
|
47
|
+
var crypto_1 = __importDefault(require("crypto"));
|
|
48
|
+
var host = process.env.API_URL || 'http://localhost:8080';
|
|
49
|
+
var RAND = function () { return Math.random().toString(36).slice(2, 10); };
|
|
50
|
+
var ENDUSER_PASSWORD = 'StripeMulti!Password1';
|
|
51
|
+
var KEY_A = 'pk_test_stripe_account_a';
|
|
52
|
+
var KEY_B = 'pk_test_stripe_account_b';
|
|
53
|
+
var poll_for = function (get, done, attempts) {
|
|
54
|
+
if (attempts === void 0) { attempts = 20; }
|
|
55
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
+
var value, i;
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
switch (_a.label) {
|
|
59
|
+
case 0: return [4 /*yield*/, get()];
|
|
60
|
+
case 1:
|
|
61
|
+
value = _a.sent();
|
|
62
|
+
i = 0;
|
|
63
|
+
_a.label = 2;
|
|
64
|
+
case 2:
|
|
65
|
+
if (!(i < attempts && !done(value))) return [3 /*break*/, 6];
|
|
66
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 250); })];
|
|
67
|
+
case 3:
|
|
68
|
+
_a.sent();
|
|
69
|
+
return [4 /*yield*/, get()];
|
|
70
|
+
case 4:
|
|
71
|
+
value = _a.sent();
|
|
72
|
+
_a.label = 5;
|
|
73
|
+
case 5:
|
|
74
|
+
i++;
|
|
75
|
+
return [3 /*break*/, 2];
|
|
76
|
+
case 6: return [2 /*return*/, value];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
var id_for = function (entries, stripeKey) {
|
|
82
|
+
var _a;
|
|
83
|
+
return ((_a = (entries !== null && entries !== void 0 ? entries : []).find(function (e) { return e.stripeKey === stripeKey; })) === null || _a === void 0 ? void 0 : _a.customerId);
|
|
84
|
+
};
|
|
85
|
+
var stripe_multiple_customer_ids_checks = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
86
|
+
var checks, record, tenant, sdk_1, businessId, enduserEmail, enduser_2, entries_after, afterA, afterB, afterCorrection, afterDirect, destination, source_1, sourceEntries, merged, sourceOnly, destinationOnly, _a, _b, mergedUnion, stripe_integration, accountA, accountB, webhookEnduser_1, purchases_for, secondAccountWebhook, secondAccountPurchases, wrongAccountWebhook, afterWrongAccount, duplicateCustomerWebhook, purchasesAfterDuplicate, afterDuplicate, enduserSDK, selfRead, selfWrite, afterSelfWrite, e_1;
|
|
87
|
+
var _c;
|
|
88
|
+
return __generator(this, function (_d) {
|
|
89
|
+
switch (_d.label) {
|
|
90
|
+
case 0:
|
|
91
|
+
checks = [];
|
|
92
|
+
record = function (label, pass, detail) { return checks.push({ label: label, pass: pass, detail: detail }); };
|
|
93
|
+
_d.label = 1;
|
|
94
|
+
case 1:
|
|
95
|
+
_d.trys.push([1, , 43, 48]);
|
|
96
|
+
return [4 /*yield*/, (0, setup_isolated_1.setup_isolated_tenant)({
|
|
97
|
+
name: "StripeMultiCustomer ".concat(RAND()),
|
|
98
|
+
users: [{ isAdmin: true }],
|
|
99
|
+
apiKeys: 0,
|
|
100
|
+
})];
|
|
101
|
+
case 2:
|
|
102
|
+
tenant = _d.sent();
|
|
103
|
+
sdk_1 = tenant.sdk, businessId = tenant.businessId;
|
|
104
|
+
enduserEmail = "stripe-multi-".concat(RAND(), "@example.com");
|
|
105
|
+
return [4 /*yield*/, sdk_1.api.endusers.createOne({ email: enduserEmail, fname: 'Stripe', lname: 'Multi' })];
|
|
106
|
+
case 3:
|
|
107
|
+
enduser_2 = _d.sent();
|
|
108
|
+
entries_after = function (expect) { return poll_for(function () { return sdk_1.api.endusers.getOne(enduser_2.id).then(function (e) { var _a; return ((_a = e.stripeCustomerIds) !== null && _a !== void 0 ? _a : []); }); }, expect); };
|
|
109
|
+
/* ===== A: a pair write is mirrored into the per-account list ===== */
|
|
110
|
+
return [4 /*yield*/, sdk_1.api.endusers.updateOne(enduser_2.id, { stripeKey: KEY_A, stripeCustomerId: 'cus_account_a' })];
|
|
111
|
+
case 4:
|
|
112
|
+
/* ===== A: a pair write is mirrored into the per-account list ===== */
|
|
113
|
+
_d.sent();
|
|
114
|
+
return [4 /*yield*/, entries_after(function (e) { return id_for(e, KEY_A) === 'cus_account_a'; })];
|
|
115
|
+
case 5:
|
|
116
|
+
afterA = _d.sent();
|
|
117
|
+
record('A1: a staff write of the pair is mirrored into stripeCustomerIds', id_for(afterA, KEY_A) === 'cus_account_a' && afterA.length === 1, "entries=".concat(JSON.stringify(afterA), " (want one entry for ").concat(KEY_A, " -> cus_account_a)"));
|
|
118
|
+
/* ===== A/B: a second account is added, and the pair does not move ===== */
|
|
119
|
+
return [4 /*yield*/, sdk_1.api.endusers.updateOne(enduser_2.id, { stripeKey: KEY_B, stripeCustomerId: 'cus_account_b' })];
|
|
120
|
+
case 6:
|
|
121
|
+
/* ===== A/B: a second account is added, and the pair does not move ===== */
|
|
122
|
+
_d.sent();
|
|
123
|
+
return [4 /*yield*/, entries_after(function (e) { return !!id_for(e, KEY_B); })];
|
|
124
|
+
case 7:
|
|
125
|
+
afterB = _d.sent();
|
|
126
|
+
record('A2: linking a second Stripe account adds an entry and keeps the first', id_for(afterB, KEY_A) === 'cus_account_a' && id_for(afterB, KEY_B) === 'cus_account_b' && afterB.length === 2, "entries=".concat(JSON.stringify(afterB), " (want both accounts; losing ").concat(KEY_A, " is the clobber this feature removes)"));
|
|
127
|
+
/* ===== C: the same account can be corrected in place ===== */
|
|
128
|
+
return [4 /*yield*/, sdk_1.api.endusers.updateOne(enduser_2.id, { stripeKey: KEY_A, stripeCustomerId: 'cus_account_a_corrected' })];
|
|
129
|
+
case 8:
|
|
130
|
+
/* ===== C: the same account can be corrected in place ===== */
|
|
131
|
+
_d.sent();
|
|
132
|
+
return [4 /*yield*/, entries_after(function (e) { return id_for(e, KEY_A) === 'cus_account_a_corrected'; })];
|
|
133
|
+
case 9:
|
|
134
|
+
afterCorrection = _d.sent();
|
|
135
|
+
record('C1: re-saving an account replaces its entry rather than duplicating it', id_for(afterCorrection, KEY_A) === 'cus_account_a_corrected'
|
|
136
|
+
&& id_for(afterCorrection, KEY_B) === 'cus_account_b'
|
|
137
|
+
&& afterCorrection.length === 2, "entries=".concat(JSON.stringify(afterCorrection)));
|
|
138
|
+
// direct staff write of the list (manual correction / API clients)
|
|
139
|
+
return [4 /*yield*/, sdk_1.api.endusers.updateOne(enduser_2.id, { stripeCustomerIds: [{ stripeKey: KEY_A, customerId: 'cus_direct_a' }] }, { replaceObjectFields: true })];
|
|
140
|
+
case 10:
|
|
141
|
+
// direct staff write of the list (manual correction / API clients)
|
|
142
|
+
_d.sent();
|
|
143
|
+
return [4 /*yield*/, sdk_1.api.endusers.getOne(enduser_2.id)];
|
|
144
|
+
case 11:
|
|
145
|
+
afterDirect = _d.sent();
|
|
146
|
+
record('C2: staff can write stripeCustomerIds directly', id_for(afterDirect.stripeCustomerIds, KEY_A) === 'cus_direct_a', "entries=".concat(JSON.stringify(afterDirect.stripeCustomerIds)));
|
|
147
|
+
return [4 /*yield*/, sdk_1.api.endusers.createOne({
|
|
148
|
+
email: "stripe-multi-dest-".concat(RAND(), "@example.com"), fname: 'Stripe', lname: 'Destination',
|
|
149
|
+
})];
|
|
150
|
+
case 12:
|
|
151
|
+
destination = _d.sent();
|
|
152
|
+
return [4 /*yield*/, sdk_1.api.endusers.createOne({
|
|
153
|
+
email: "stripe-multi-src-".concat(RAND(), "@example.com"), fname: 'Stripe', lname: 'Source',
|
|
154
|
+
})];
|
|
155
|
+
case 13:
|
|
156
|
+
source_1 = _d.sent();
|
|
157
|
+
return [4 /*yield*/, sdk_1.api.endusers.updateOne(destination.id, { stripeCustomerIds: [{ stripeKey: KEY_A, customerId: 'cus_destination_a' }, { stripeKey: KEY_B, customerId: 'cus_destination_b' }] }, { replaceObjectFields: true })];
|
|
158
|
+
case 14:
|
|
159
|
+
_d.sent();
|
|
160
|
+
return [4 /*yield*/, sdk_1.api.endusers.updateOne(source_1.id, { stripeKey: KEY_B, stripeCustomerId: 'cus_source_b' })];
|
|
161
|
+
case 15:
|
|
162
|
+
_d.sent();
|
|
163
|
+
return [4 /*yield*/, poll_for(function () { return sdk_1.api.endusers.getOne(source_1.id).then(function (e) { var _a; return ((_a = e.stripeCustomerIds) !== null && _a !== void 0 ? _a : []); }); }, function (e) { return !!id_for(e, KEY_B); })];
|
|
164
|
+
case 16:
|
|
165
|
+
sourceEntries = _d.sent();
|
|
166
|
+
return [4 /*yield*/, sdk_1.api.endusers.merge({ sourceEnduserId: source_1.id, destinationEnduserId: destination.id })];
|
|
167
|
+
case 17:
|
|
168
|
+
_d.sent();
|
|
169
|
+
return [4 /*yield*/, sdk_1.api.endusers.getOne(destination.id)];
|
|
170
|
+
case 18:
|
|
171
|
+
merged = (_d.sent()).stripeCustomerIds;
|
|
172
|
+
record('D1: merge keeps the destination id for an account both patients were linked to', id_for(merged, KEY_B) === 'cus_destination_b' && id_for(merged, KEY_A) === 'cus_destination_a'
|
|
173
|
+
&& (merged !== null && merged !== void 0 ? merged : []).length === 2, "merged=".concat(JSON.stringify(merged), " source had ").concat(JSON.stringify(sourceEntries)));
|
|
174
|
+
return [4 /*yield*/, sdk_1.api.endusers.createOne({
|
|
175
|
+
email: "stripe-multi-src2-".concat(RAND(), "@example.com"), fname: 'Stripe', lname: 'SourceOnly',
|
|
176
|
+
stripeKey: KEY_B, stripeCustomerId: 'cus_source_only_b',
|
|
177
|
+
})];
|
|
178
|
+
case 19:
|
|
179
|
+
sourceOnly = _d.sent();
|
|
180
|
+
return [4 /*yield*/, sdk_1.api.endusers.createOne({
|
|
181
|
+
email: "stripe-multi-dest2-".concat(RAND(), "@example.com"), fname: 'Stripe', lname: 'DestinationOnly',
|
|
182
|
+
stripeKey: KEY_A, stripeCustomerId: 'cus_dest_only_a',
|
|
183
|
+
})];
|
|
184
|
+
case 20:
|
|
185
|
+
destinationOnly = _d.sent();
|
|
186
|
+
_a = record;
|
|
187
|
+
_b = ['D2 setup: a patient created with the pair alone carries no per-account list'];
|
|
188
|
+
return [4 /*yield*/, sdk_1.api.endusers.getOne(sourceOnly.id)];
|
|
189
|
+
case 21:
|
|
190
|
+
_a.apply(void 0, _b.concat([!((_c = (_d.sent()).stripeCustomerIds) !== null && _c !== void 0 ? _c : []).length,
|
|
191
|
+
'the legacy shape this merge has to cope with']));
|
|
192
|
+
return [4 /*yield*/, sdk_1.api.endusers.merge({ sourceEnduserId: sourceOnly.id, destinationEnduserId: destinationOnly.id })];
|
|
193
|
+
case 22:
|
|
194
|
+
_d.sent();
|
|
195
|
+
return [4 /*yield*/, sdk_1.api.endusers.getOne(destinationOnly.id)];
|
|
196
|
+
case 23:
|
|
197
|
+
mergedUnion = (_d.sent()).stripeCustomerIds;
|
|
198
|
+
record('D3: merging two legacy-pair patients lists both accounts on the survivor', id_for(mergedUnion, KEY_A) === 'cus_dest_only_a' && id_for(mergedUnion, KEY_B) === 'cus_source_only_b', "merged=".concat(JSON.stringify(mergedUnion), " (the survivor must be chargeable on both accounts)"));
|
|
199
|
+
stripe_integration = function (sdkSession) { return __awaiter(void 0, void 0, void 0, function () {
|
|
200
|
+
var stripePublicKey, webhooksSecret;
|
|
201
|
+
return __generator(this, function (_a) {
|
|
202
|
+
switch (_a.label) {
|
|
203
|
+
case 0:
|
|
204
|
+
stripePublicKey = "pk_test_multi_".concat(Date.now(), "_").concat(Math.floor(Math.random() * 1e6));
|
|
205
|
+
webhooksSecret = "whsec_test_".concat(crypto_1.default.randomBytes(16).toString('hex'));
|
|
206
|
+
return [4 /*yield*/, sdkSession.api.integrations.createOne({
|
|
207
|
+
title: 'Stripe',
|
|
208
|
+
environment: stripe_webhook_helpers_1.TEST_STRIPE_ENVIRONMENT,
|
|
209
|
+
authentication: {
|
|
210
|
+
type: 'apiKey',
|
|
211
|
+
info: {
|
|
212
|
+
access_token: 'sk_test_unused_by_this_path',
|
|
213
|
+
refresh_token: 'unused',
|
|
214
|
+
scope: '',
|
|
215
|
+
expiry_date: Date.now(),
|
|
216
|
+
token_type: 'Bearer',
|
|
217
|
+
external_id: stripePublicKey,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
webhooksSecret: webhooksSecret,
|
|
221
|
+
})];
|
|
222
|
+
case 1:
|
|
223
|
+
_a.sent();
|
|
224
|
+
return [2 /*return*/, { stripePublicKey: stripePublicKey, webhooksSecret: webhooksSecret }];
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}); };
|
|
228
|
+
return [4 /*yield*/, stripe_integration(sdk_1)];
|
|
229
|
+
case 24:
|
|
230
|
+
accountA = _d.sent();
|
|
231
|
+
return [4 /*yield*/, stripe_integration(sdk_1)];
|
|
232
|
+
case 25:
|
|
233
|
+
accountB = _d.sent();
|
|
234
|
+
return [4 /*yield*/, sdk_1.api.endusers.createOne({
|
|
235
|
+
email: "stripe-multi-webhook-".concat(RAND(), "@example.com"), fname: 'Stripe', lname: 'Webhook',
|
|
236
|
+
})
|
|
237
|
+
// linked to account A by the pinned pair, and to account B only through the per-account list —
|
|
238
|
+
// exactly the shape a patient ends up in after buying on a second Stripe account
|
|
239
|
+
];
|
|
240
|
+
case 26:
|
|
241
|
+
webhookEnduser_1 = _d.sent();
|
|
242
|
+
// linked to account A by the pinned pair, and to account B only through the per-account list —
|
|
243
|
+
// exactly the shape a patient ends up in after buying on a second Stripe account
|
|
244
|
+
return [4 /*yield*/, sdk_1.api.endusers.updateOne(webhookEnduser_1.id, { stripeKey: accountA.stripePublicKey, stripeCustomerId: 'cus_webhook_a' })];
|
|
245
|
+
case 27:
|
|
246
|
+
// linked to account A by the pinned pair, and to account B only through the per-account list —
|
|
247
|
+
// exactly the shape a patient ends up in after buying on a second Stripe account
|
|
248
|
+
_d.sent();
|
|
249
|
+
return [4 /*yield*/, sdk_1.api.endusers.updateOne(webhookEnduser_1.id, { stripeCustomerIds: [
|
|
250
|
+
{ stripeKey: accountA.stripePublicKey, customerId: 'cus_webhook_a' },
|
|
251
|
+
{ stripeKey: accountB.stripePublicKey, customerId: 'cus_webhook_b' },
|
|
252
|
+
] }, { replaceObjectFields: true })];
|
|
253
|
+
case 28:
|
|
254
|
+
_d.sent();
|
|
255
|
+
purchases_for = function () { return sdk_1.api.purchases.getSome({ filter: { enduserId: webhookEnduser_1.id } }); };
|
|
256
|
+
return [4 /*yield*/, (0, stripe_webhook_helpers_1.post_stripe_webhook)({
|
|
257
|
+
stripePublicKey: accountB.stripePublicKey,
|
|
258
|
+
secret: accountB.webhooksSecret,
|
|
259
|
+
event: (0, stripe_webhook_helpers_1.invoice_paid_event)({ stripeCustomerId: 'cus_webhook_b' }),
|
|
260
|
+
})];
|
|
261
|
+
case 29:
|
|
262
|
+
secondAccountWebhook = _d.sent();
|
|
263
|
+
return [4 /*yield*/, poll_for(purchases_for, function (p) { return p.length > 0; })];
|
|
264
|
+
case 30:
|
|
265
|
+
secondAccountPurchases = _d.sent();
|
|
266
|
+
record('F1: an invoice.paid from the second account is attributed to the patient linked to it', secondAccountWebhook.status === 200 && secondAccountPurchases.length === 1, "webhook=".concat(secondAccountWebhook.status, " purchases=").concat(secondAccountPurchases.length)
|
|
267
|
+
+ ' — 0 means the lookup only read the pinned pair, so the second account matches no patient');
|
|
268
|
+
return [4 /*yield*/, (0, stripe_webhook_helpers_1.post_stripe_webhook)({
|
|
269
|
+
stripePublicKey: accountA.stripePublicKey,
|
|
270
|
+
secret: accountA.webhooksSecret,
|
|
271
|
+
event: (0, stripe_webhook_helpers_1.invoice_paid_event)({ stripeCustomerId: 'cus_webhook_b' }),
|
|
272
|
+
})];
|
|
273
|
+
case 31:
|
|
274
|
+
wrongAccountWebhook = _d.sent();
|
|
275
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1500); })];
|
|
276
|
+
case 32:
|
|
277
|
+
_d.sent();
|
|
278
|
+
return [4 /*yield*/, purchases_for()];
|
|
279
|
+
case 33:
|
|
280
|
+
afterWrongAccount = _d.sent();
|
|
281
|
+
record('F2: an id belonging to another account does not resolve through this one', wrongAccountWebhook.status === 200 && afterWrongAccount.length === 1, "webhook=".concat(wrongAccountWebhook.status, " purchases=").concat(afterWrongAccount.length, " (want the 1 from F1)"));
|
|
282
|
+
return [4 /*yield*/, (0, stripe_webhook_helpers_1.post_stripe_webhook)({
|
|
283
|
+
stripePublicKey: accountB.stripePublicKey,
|
|
284
|
+
secret: accountB.webhooksSecret,
|
|
285
|
+
event: {
|
|
286
|
+
type: 'invoice.paid',
|
|
287
|
+
data: {
|
|
288
|
+
object: {
|
|
289
|
+
id: "in_test_dupe_".concat(Date.now()),
|
|
290
|
+
customer: 'cus_webhook_b_duplicate',
|
|
291
|
+
customer_email: webhookEnduser_1.email,
|
|
292
|
+
amount_paid: 1999,
|
|
293
|
+
lines: { object: 'list', data: [], has_more: false },
|
|
294
|
+
discount: null,
|
|
295
|
+
discounts: [],
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
})
|
|
300
|
+
// the second purchase is what proves the handler REACHED the linkage write: it means the email
|
|
301
|
+
// fallback matched this patient, so "the entry did not move" is a decision and not a no-op
|
|
302
|
+
];
|
|
303
|
+
case 34:
|
|
304
|
+
duplicateCustomerWebhook = _d.sent();
|
|
305
|
+
return [4 /*yield*/, poll_for(purchases_for, function (p) { return p.length > 1; })];
|
|
306
|
+
case 35:
|
|
307
|
+
purchasesAfterDuplicate = _d.sent();
|
|
308
|
+
return [4 /*yield*/, poll_for(function () { return sdk_1.api.endusers.getOne(webhookEnduser_1.id).then(function (e) { var _a; return ((_a = e.stripeCustomerIds) !== null && _a !== void 0 ? _a : []); }); }, function () { return false; }, // always poll to the end, so a late write would be seen
|
|
309
|
+
6)];
|
|
310
|
+
case 36:
|
|
311
|
+
afterDuplicate = _d.sent();
|
|
312
|
+
record('F3: a webhook for a different customer on an already-linked account does not repoint it', duplicateCustomerWebhook.status === 200
|
|
313
|
+
&& purchasesAfterDuplicate.length === 2
|
|
314
|
+
&& id_for(afterDuplicate, accountB.stripePublicKey) === 'cus_webhook_b', "webhook=".concat(duplicateCustomerWebhook.status, " purchases=").concat(purchasesAfterDuplicate.length, " (want 2,")
|
|
315
|
+
+ " so the email fallback matched and the linkage write was reached) entries=".concat(JSON.stringify(afterDuplicate)));
|
|
316
|
+
/* ===== E: never visible or writable from a patient session ===== */
|
|
317
|
+
return [4 /*yield*/, sdk_1.api.endusers.set_password({ id: enduser_2.id, password: ENDUSER_PASSWORD })];
|
|
318
|
+
case 37:
|
|
319
|
+
/* ===== E: never visible or writable from a patient session ===== */
|
|
320
|
+
_d.sent();
|
|
321
|
+
enduserSDK = new enduser_1.EnduserSession({ host: host, businessId: businessId });
|
|
322
|
+
return [4 /*yield*/, enduserSDK.authenticate(enduserEmail, ENDUSER_PASSWORD)];
|
|
323
|
+
case 38:
|
|
324
|
+
_d.sent();
|
|
325
|
+
return [4 /*yield*/, enduserSDK.api.endusers.getOne(enduser_2.id)];
|
|
326
|
+
case 39:
|
|
327
|
+
selfRead = _d.sent();
|
|
328
|
+
record('E1: a model read from a patient session is redacted', !selfRead.stripeCustomerIds && !selfRead.stripeCustomerId, "enduser read back stripeCustomerIds=".concat(JSON.stringify(selfRead.stripeCustomerIds))
|
|
329
|
+
+ " stripeCustomerId=".concat(JSON.stringify(selfRead.stripeCustomerId)));
|
|
330
|
+
// The login / refresh payloads return the enduser record itself, NOT a schema-redacted model
|
|
331
|
+
// read, so this is a separate exposure path — it is how the portal receives its own record, and
|
|
332
|
+
// how stripeCustomerId (which the portal's Manage Subscriptions button needs) reaches it.
|
|
333
|
+
record('E1b: the login payload the portal receives carries no per-account customer ids', !enduserSDK.userInfo.stripeCustomerIds, "login payload stripeCustomerIds=".concat(JSON.stringify(enduserSDK.userInfo.stripeCustomerIds))
|
|
334
|
+
+ " (stripeCustomerId=".concat(JSON.stringify(enduserSDK.userInfo.stripeCustomerId), " stays, the portal reads it)"));
|
|
335
|
+
return [4 /*yield*/, enduserSDK.refresh_session()];
|
|
336
|
+
case 40:
|
|
337
|
+
_d.sent();
|
|
338
|
+
record('E1c: the refresh_session payload carries no per-account customer ids', !enduserSDK.userInfo.stripeCustomerIds, "refreshed payload stripeCustomerIds=".concat(JSON.stringify(enduserSDK.userInfo.stripeCustomerIds)));
|
|
339
|
+
return [4 /*yield*/, enduserSDK.api.endusers.updateOne(enduser_2.id, { stripeCustomerIds: [{ stripeKey: KEY_A, customerId: 'cus_attacker' }] }).then(function () { return ({ resolved: true }); }).catch(function (e) { return ({ rejected: (e === null || e === void 0 ? void 0 : e.message) || String(e) }); })];
|
|
340
|
+
case 41:
|
|
341
|
+
selfWrite = _d.sent();
|
|
342
|
+
return [4 /*yield*/, sdk_1.api.endusers.getOne(enduser_2.id)];
|
|
343
|
+
case 42:
|
|
344
|
+
afterSelfWrite = _d.sent();
|
|
345
|
+
record('E2: a patient cannot write the per-account customer ids', selfWrite.rejected === 'stripeCustomerIds cannot be updated by endusers'
|
|
346
|
+
&& id_for(afterSelfWrite.stripeCustomerIds, KEY_A) === 'cus_direct_a', "result=".concat(JSON.stringify(selfWrite), " entries=").concat(JSON.stringify(afterSelfWrite.stripeCustomerIds)));
|
|
347
|
+
return [3 /*break*/, 48];
|
|
348
|
+
case 43:
|
|
349
|
+
if (!tenant) return [3 /*break*/, 47];
|
|
350
|
+
_d.label = 44;
|
|
351
|
+
case 44:
|
|
352
|
+
_d.trys.push([44, 46, , 47]);
|
|
353
|
+
return [4 /*yield*/, tenant.teardown()];
|
|
354
|
+
case 45:
|
|
355
|
+
_d.sent();
|
|
356
|
+
return [3 /*break*/, 47];
|
|
357
|
+
case 46:
|
|
358
|
+
e_1 = _d.sent();
|
|
359
|
+
console.error('teardown failed', e_1);
|
|
360
|
+
return [3 /*break*/, 47];
|
|
361
|
+
case 47: return [7 /*endfinally*/];
|
|
362
|
+
case 48: return [2 /*return*/, checks];
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
}); };
|
|
366
|
+
exports.stripe_multiple_customer_ids_checks = stripe_multiple_customer_ids_checks;
|
|
367
|
+
/** Asserting wrapper, for standalone runs and for sequential use in the suite. */
|
|
368
|
+
var stripe_multiple_customer_ids_tests = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
369
|
+
var _a, _b;
|
|
370
|
+
return __generator(this, function (_c) {
|
|
371
|
+
switch (_c.label) {
|
|
372
|
+
case 0:
|
|
373
|
+
_a = setup_isolated_1.assert_checks;
|
|
374
|
+
_b = ['Stripe multiple customer ids'];
|
|
375
|
+
return [4 /*yield*/, (0, exports.stripe_multiple_customer_ids_checks)()];
|
|
376
|
+
case 1:
|
|
377
|
+
_a.apply(void 0, _b.concat([_c.sent()]));
|
|
378
|
+
return [2 /*return*/];
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}); };
|
|
382
|
+
exports.stripe_multiple_customer_ids_tests = stripe_multiple_customer_ids_tests;
|
|
383
|
+
// Allow running this test file independently
|
|
384
|
+
if (require.main === module) {
|
|
385
|
+
console.log("\uD83C\uDF10 Using API URL: ".concat(host));
|
|
386
|
+
(0, exports.stripe_multiple_customer_ids_tests)()
|
|
387
|
+
.then(function () {
|
|
388
|
+
console.log("✅ Stripe multiple customer ids test suite completed successfully");
|
|
389
|
+
process.exit(0);
|
|
390
|
+
})
|
|
391
|
+
.catch(function (error) {
|
|
392
|
+
console.error("❌ Stripe multiple customer ids test suite failed:", error);
|
|
393
|
+
process.exit(1);
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
//# sourceMappingURL=stripe_multiple_customer_ids.test.js.map
|