@tellescope/sdk 2.0.0-beta.1 → 2.0.0-beta.2
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 +373 -3
- package/lib/cjs/sdk.d.ts.map +1 -1
- package/lib/cjs/sdk.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/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/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/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_threads_care_team.test.d.ts +3 -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 +3 -1
- package/lib/cjs/tests/api_tests/load_threads_care_team.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 +3 -1
- package/lib/cjs/tests/api_tests/organization_signup.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/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 +73 -17
- 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/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/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/register_business_id_injection.test.js +2 -2
- 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/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/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/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/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/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/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/setup_isolated.d.ts +48 -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 +374 -292
- package/lib/cjs/tests/tests.js.map +1 -1
- 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 +373 -3
- package/lib/esm/sdk.d.ts.map +1 -1
- package/lib/esm/sdk.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/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/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/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_threads_care_team.test.d.ts +3 -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 +2 -0
- package/lib/esm/tests/api_tests/load_threads_care_team.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 +2 -0
- package/lib/esm/tests/api_tests/organization_signup.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/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 +72 -16
- 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/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/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/register_business_id_injection.test.js +2 -2
- 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/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/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/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/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/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/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/setup_isolated.d.ts +48 -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 +375 -293
- package/lib/esm/tests/tests.js.map +1 -1
- 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 +3 -2
- package/src/tests/api_tests/booking_prevent_upcoming_duplicate.test.ts +541 -0
- 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/form_vital_reading.test.ts +393 -0
- 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_threads_care_team.test.ts +4 -0
- package/src/tests/api_tests/organization_signup.test.ts +4 -0
- package/src/tests/api_tests/phone_embed_leave_message.test.ts +541 -0
- package/src/tests/api_tests/programs.test.ts +351 -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/appointment-reschedule-ownership.test.ts +4 -0
- 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/register_business_id_injection.test.ts +2 -2
- package/src/tests/api_tests/security/rich-text-answer-sanitized-on-write.test.ts +4 -0
- 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/stripe_checkout_items.test.ts +186 -0
- 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/trigger_contains_matching.test.ts +4 -0
- package/src/tests/api_tests/user_logs_restore_deleted.test.ts +4 -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/setup_isolated.ts +140 -0
- package/src/tests/tests.ts +124 -30
- 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,220 @@
|
|
|
1
|
+
require('source-map-support').install();
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
assert_checks,
|
|
5
|
+
Check,
|
|
6
|
+
setup_isolated_tenant,
|
|
7
|
+
IsolatedSuite,
|
|
8
|
+
} from "../setup_isolated"
|
|
9
|
+
|
|
10
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The backend contract behind the Journey editor's manual per-step count.
|
|
14
|
+
*
|
|
15
|
+
* When the journey statistics aggregation cannot produce numbers, a step node offers a "Get count"
|
|
16
|
+
* link that counts that one step through the ORDINARY automated_actions read — no new endpoint:
|
|
17
|
+
*
|
|
18
|
+
* automated_actions.getSome({ returnCount: true, filter: { automationStepId } })
|
|
19
|
+
* automated_actions.getSome({ returnCount: true, filter: { automationStepId, status: 'finished' } })
|
|
20
|
+
*
|
|
21
|
+
* Two properties the UI depends on and that nothing else covers:
|
|
22
|
+
*
|
|
23
|
+
* 1. `returnCount` resolves to `{ count }` (not a list), and `filter` is actually applied to the
|
|
24
|
+
* count — `queries.count` takes a different code path from `findPage`, so "the filter is
|
|
25
|
+
* honoured" is a real assertion, not a tautology. A count that ignored `filter` would silently
|
|
26
|
+
* report the whole tenant's automated_actions on every step.
|
|
27
|
+
* 2. The count is session-scoped the same way the list read is, so it equals the number of rows
|
|
28
|
+
* the step drawer lists for that same session. This is what makes a lower number for a
|
|
29
|
+
* restricted user correct rather than a bug — and it is asserted by comparing the count with
|
|
30
|
+
* the rows, for an admin and for a non-admin, rather than by hardcoding either access level.
|
|
31
|
+
*
|
|
32
|
+
* `setup_isolated` because every assertion here is an exact count over a whole businessId
|
|
33
|
+
* partition; on the shared org, other journey suites leave automated_actions behind.
|
|
34
|
+
*
|
|
35
|
+
* automated_actions are seeded directly rather than by driving a real journey: the counts are what
|
|
36
|
+
* is under test, and seeding makes the expected numbers exact and the run fast. `processAfter` is
|
|
37
|
+
* far in the future so the worker cannot process (and so mutate) them mid-assertion.
|
|
38
|
+
*/
|
|
39
|
+
export const journey_step_manual_count_checks = async (): Promise<Check[]> => {
|
|
40
|
+
const checks: Check[] = []
|
|
41
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
42
|
+
|
|
43
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
tenant = await setup_isolated_tenant({
|
|
47
|
+
name: `JourneyStepManualCount ${RAND()}`,
|
|
48
|
+
users: [{ isAdmin: true }, { roles: ['Non-Admin'] }],
|
|
49
|
+
apiKeys: 0,
|
|
50
|
+
})
|
|
51
|
+
const { sdk, sdkNonAdmin } = tenant
|
|
52
|
+
|
|
53
|
+
/* ================= fixtures ================= */
|
|
54
|
+
|
|
55
|
+
const journey = await sdk.api.journeys.createOne({ title: `Manual Count ${RAND()}` })
|
|
56
|
+
|
|
57
|
+
const makeStep = (status: string) => sdk.api.automation_steps.createOne({
|
|
58
|
+
journeyId: journey.id,
|
|
59
|
+
action: { type: 'setEnduserStatus', info: { status } },
|
|
60
|
+
events: [{ type: 'onJourneyStart', info: {} }],
|
|
61
|
+
})
|
|
62
|
+
// counted, a second step to prove the filter discriminates, and one that is never entered
|
|
63
|
+
const [countedStep, otherStep, emptyStep] = await Promise.all([
|
|
64
|
+
makeStep('Counted'), makeStep('Other'), makeStep('Empty'),
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
const enduser = await sdk.api.endusers.createOne({
|
|
68
|
+
fname: 'Manual', lname: 'Count', email: `dontsend-manual-count-${RAND()}@tellescope.com`,
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
const seed = (automationStepId: string, status: 'finished' | 'active' | 'cancelled' | 'error') => (
|
|
72
|
+
sdk.api.automated_actions.createOne({
|
|
73
|
+
journeyId: journey.id,
|
|
74
|
+
automationStepId,
|
|
75
|
+
enduserId: enduser.id,
|
|
76
|
+
processAfter: Date.now() + 1000000,
|
|
77
|
+
status,
|
|
78
|
+
event: { type: 'onJourneyStart', info: {} },
|
|
79
|
+
action: { type: 'setEnduserStatus', info: { status: 'Counted' } },
|
|
80
|
+
})
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
// countedStep: 3 finished, 2 active, 1 cancelled, 1 error => total 7, finished 3.
|
|
84
|
+
// The non-finished statuses matter: the UI shows Total and Finished only, so a count that
|
|
85
|
+
// quietly excluded cancelled/error rows would still look plausible with a simpler fixture.
|
|
86
|
+
await Promise.all([
|
|
87
|
+
seed(countedStep.id, 'finished'), seed(countedStep.id, 'finished'), seed(countedStep.id, 'finished'),
|
|
88
|
+
seed(countedStep.id, 'active'), seed(countedStep.id, 'active'),
|
|
89
|
+
seed(countedStep.id, 'cancelled'),
|
|
90
|
+
seed(countedStep.id, 'error'),
|
|
91
|
+
// a second step, so a filter that was dropped would report 9 rather than 7
|
|
92
|
+
seed(otherStep.id, 'finished'), seed(otherStep.id, 'active'),
|
|
93
|
+
])
|
|
94
|
+
|
|
95
|
+
/* ================= helpers ================= */
|
|
96
|
+
|
|
97
|
+
// getSome is typed Promise<T[]>, but a returnCount read resolves to { count }
|
|
98
|
+
const count_for = async (session: typeof sdk, automationStepId: string, status?: string) => (
|
|
99
|
+
await session.api.automated_actions.getSome({
|
|
100
|
+
returnCount: true,
|
|
101
|
+
filter: { automationStepId, ...(status ? { status } : { }) } as any,
|
|
102
|
+
}) as unknown as { count?: number }
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
const rows_for = (session: typeof sdk, automationStepId: string, status?: string) => (
|
|
106
|
+
session.api.automated_actions.getSome({
|
|
107
|
+
limit: 100, // the step drawer's page size
|
|
108
|
+
filter: { automationStepId, ...(status ? { status } : { }) } as any,
|
|
109
|
+
})
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
/* ====== 1. returnCount + filter: the shape and the arithmetic ====== */
|
|
113
|
+
|
|
114
|
+
const total = await count_for(sdk, countedStep.id)
|
|
115
|
+
record(
|
|
116
|
+
'1a. returnCount resolves to { count }, not a list of records',
|
|
117
|
+
!Array.isArray(total) && typeof total?.count === 'number',
|
|
118
|
+
`response=${JSON.stringify(total)}`,
|
|
119
|
+
)
|
|
120
|
+
record(
|
|
121
|
+
'1b. the count is filtered to the step, counting every status',
|
|
122
|
+
total?.count === 7,
|
|
123
|
+
`count=${JSON.stringify(total?.count)}, expected 7 (3 finished + 2 active + 1 cancelled + 1 error)`,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
const finished = await count_for(sdk, countedStep.id, 'finished')
|
|
127
|
+
record(
|
|
128
|
+
'1c. adding status: finished narrows the same count',
|
|
129
|
+
finished?.count === 3,
|
|
130
|
+
`count=${JSON.stringify(finished?.count)}, expected 3`,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
// if `filter` were dropped on the count path, both steps would report the tenant-wide 9
|
|
134
|
+
const otherTotal = await count_for(sdk, otherStep.id)
|
|
135
|
+
record(
|
|
136
|
+
'1d. a different step counts separately, so the filter is genuinely applied',
|
|
137
|
+
otherTotal?.count === 2,
|
|
138
|
+
`count=${JSON.stringify(otherTotal?.count)}, expected 2 (and NOT 9, the tenant-wide total)`,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
// QA step 13: a step nobody has entered is 0, not a failure
|
|
142
|
+
const emptyTotal = await count_for(sdk, emptyStep.id)
|
|
143
|
+
record(
|
|
144
|
+
'1e. a step with no automated actions counts 0 rather than erroring',
|
|
145
|
+
emptyTotal?.count === 0,
|
|
146
|
+
`count=${JSON.stringify(emptyTotal?.count)}`,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
/* ====== 2. the count equals the rows the step drawer lists ====== */
|
|
150
|
+
|
|
151
|
+
const [adminRows, adminFinishedRows] = await Promise.all([
|
|
152
|
+
rows_for(sdk, countedStep.id),
|
|
153
|
+
rows_for(sdk, countedStep.id, 'finished'),
|
|
154
|
+
])
|
|
155
|
+
record(
|
|
156
|
+
'2a. the admin count equals the rows the same session can list',
|
|
157
|
+
total?.count === adminRows.length && finished?.count === adminFinishedRows.length,
|
|
158
|
+
`count=${total?.count} vs rows=${adminRows.length};`
|
|
159
|
+
+ ` finished count=${finished?.count} vs rows=${adminFinishedRows.length}`,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
/* ====== 3. the count is session-scoped, the same way the list read is ====== */
|
|
163
|
+
|
|
164
|
+
// The point is NOT that a non-admin sees a particular number — that depends on the tenant's
|
|
165
|
+
// role-based access for automated_actions. It is that whatever they can READ is what they
|
|
166
|
+
// COUNT, so the number on the node always matches the drawer they open from it.
|
|
167
|
+
const [nonAdminTotal, nonAdminFinished] = await Promise.all([
|
|
168
|
+
count_for(sdkNonAdmin, countedStep.id),
|
|
169
|
+
count_for(sdkNonAdmin, countedStep.id, 'finished'),
|
|
170
|
+
])
|
|
171
|
+
const [nonAdminRows, nonAdminFinishedRows] = await Promise.all([
|
|
172
|
+
rows_for(sdkNonAdmin, countedStep.id),
|
|
173
|
+
rows_for(sdkNonAdmin, countedStep.id, 'finished'),
|
|
174
|
+
])
|
|
175
|
+
|
|
176
|
+
record(
|
|
177
|
+
'3a. a non-admin count equals the rows that non-admin can list',
|
|
178
|
+
nonAdminTotal?.count === nonAdminRows.length
|
|
179
|
+
&& nonAdminFinished?.count === nonAdminFinishedRows.length,
|
|
180
|
+
`count=${nonAdminTotal?.count} vs rows=${nonAdminRows.length};`
|
|
181
|
+
+ ` finished count=${nonAdminFinished?.count} vs rows=${nonAdminFinishedRows.length}`,
|
|
182
|
+
)
|
|
183
|
+
// a restricted session may legitimately count lower, but never higher than the admin
|
|
184
|
+
record(
|
|
185
|
+
'3b. a non-admin never counts more than the admin',
|
|
186
|
+
(nonAdminTotal?.count ?? 0) <= (total?.count ?? 0)
|
|
187
|
+
&& (nonAdminFinished?.count ?? 0) <= (finished?.count ?? 0),
|
|
188
|
+
`non-admin total=${nonAdminTotal?.count} vs admin ${total?.count};`
|
|
189
|
+
+ ` non-admin finished=${nonAdminFinished?.count} vs admin ${finished?.count}`,
|
|
190
|
+
)
|
|
191
|
+
record(
|
|
192
|
+
'3c. finished never exceeds the total, for either session',
|
|
193
|
+
(finished?.count ?? 0) <= (total?.count ?? 0)
|
|
194
|
+
&& (nonAdminFinished?.count ?? 0) <= (nonAdminTotal?.count ?? 0),
|
|
195
|
+
`admin ${finished?.count}/${total?.count}, non-admin ${nonAdminFinished?.count}/${nonAdminTotal?.count}`,
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
return checks
|
|
199
|
+
} finally {
|
|
200
|
+
await tenant?.teardown()
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** Asserting wrapper, for standalone runs. */
|
|
205
|
+
export const journey_step_manual_count_tests = async () => {
|
|
206
|
+
assert_checks('Journey step manual count', await journey_step_manual_count_checks())
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
210
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'Journey step manual count', run: journey_step_manual_count_checks }
|
|
211
|
+
|
|
212
|
+
// Allow running this test file independently
|
|
213
|
+
if (require.main === module) {
|
|
214
|
+
const host = process.env.API_URL || 'http://localhost:8080'
|
|
215
|
+
console.log(`🌐 Using API URL: ${host}`)
|
|
216
|
+
|
|
217
|
+
journey_step_manual_count_tests()
|
|
218
|
+
.then(() => { console.log("✅ Journey step manual count tests passed"); process.exit(0) })
|
|
219
|
+
.catch(error => { console.error("❌ Journey step manual count tests failed:", error); process.exit(1) })
|
|
220
|
+
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
assert_checks,
|
|
5
5
|
Check,
|
|
6
6
|
setup_isolated_tenant,
|
|
7
|
+
IsolatedSuite,
|
|
7
8
|
} from "../setup_isolated"
|
|
8
9
|
|
|
9
10
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
@@ -195,6 +196,9 @@ export const load_threads_care_team_tests = async () => {
|
|
|
195
196
|
assert_checks('Load threads care team', await load_threads_care_team_checks())
|
|
196
197
|
}
|
|
197
198
|
|
|
199
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
200
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'Load threads care team', run: load_threads_care_team_checks }
|
|
201
|
+
|
|
198
202
|
// Allow running this test file independently
|
|
199
203
|
if (require.main === module) {
|
|
200
204
|
console.log(`🌐 Using API URL: ${host}`)
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
set_email_verification_code,
|
|
11
11
|
setup_isolated_tenant,
|
|
12
12
|
test_support_request,
|
|
13
|
+
IsolatedSuite,
|
|
13
14
|
} from "../setup_isolated"
|
|
14
15
|
|
|
15
16
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
@@ -225,6 +226,9 @@ export const organization_signup_tests = async () => {
|
|
|
225
226
|
assert_checks('Organization signup', await organization_signup_checks())
|
|
226
227
|
}
|
|
227
228
|
|
|
229
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
230
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'Organization signup', run: organization_signup_checks }
|
|
231
|
+
|
|
228
232
|
// Allow running this test file independently
|
|
229
233
|
if (require.main === module) {
|
|
230
234
|
console.log(`🌐 Using API URL: ${host}`)
|