@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,186 @@
|
|
|
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
|
+
import { authenticate_enduser_via_token } from "../setup"
|
|
10
|
+
import { EnduserSession } from "../../sdk"
|
|
11
|
+
|
|
12
|
+
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
13
|
+
|
|
14
|
+
const RAND = () => Math.random().toString(36).slice(2, 10)
|
|
15
|
+
|
|
16
|
+
const ENDUSER_RAW_IDS_MESSAGE = "stripePriceId and subscriptionPriceId are not supported for enduser sessions"
|
|
17
|
+
const QUANTITY_MESSAGE = "quantity must be a whole number of at least 1"
|
|
18
|
+
const EXACTLY_ONE_ID_MESSAGE = "Each items entry must specify exactly one of productId, stripePriceId, or subscriptionPriceId"
|
|
19
|
+
// what the handler throws once a request is past every items guard and no Stripe account is
|
|
20
|
+
// configured - the marker for "this cart was accepted, it only ran out of Stripe"
|
|
21
|
+
const NO_STRIPE_MESSAGE = "Stripe Connection not found"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The guards on the `items` parameter of products/prepare-stripe-checkout that run BEFORE any Stripe
|
|
25
|
+
* integration is resolved, so they are reachable without a Stripe account: the enduser rejection of
|
|
26
|
+
* raw Stripe price ids, the productIds/items exclusivity, the per-entry shape rules and the quantity
|
|
27
|
+
* validator.
|
|
28
|
+
*
|
|
29
|
+
* The quantity guards themselves (the cap of 99, the two "greater than 1" rejections) sit on the
|
|
30
|
+
* Stripe Custom branch and are pinned instead by the unit suite in
|
|
31
|
+
* packages/private/api/api/integrations/payments/stripe_line_items.test.ts, which needs no database
|
|
32
|
+
* and no Stripe account. Anything that creates or inspects a real Checkout session is manual QA.
|
|
33
|
+
*/
|
|
34
|
+
export const stripe_checkout_items_checks = async (): Promise<Check[]> => {
|
|
35
|
+
const checks: Check[] = []
|
|
36
|
+
const record = (label: string, pass: boolean, detail: string) => checks.push({ label, pass, detail })
|
|
37
|
+
|
|
38
|
+
let tenant: Awaited<ReturnType<typeof setup_isolated_tenant>> | undefined
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
tenant = await setup_isolated_tenant({
|
|
42
|
+
name: `stripe items ${RAND()}`,
|
|
43
|
+
users: [{ isAdmin: true }],
|
|
44
|
+
apiKeys: 0,
|
|
45
|
+
})
|
|
46
|
+
const { sdk, businessId } = tenant
|
|
47
|
+
|
|
48
|
+
const product = await sdk.api.products.createOne({
|
|
49
|
+
title: `Checkout Item Product ${RAND()}`,
|
|
50
|
+
cost: { amount: 500, currency: 'USD' },
|
|
51
|
+
processor: 'Stripe',
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const enduser = await sdk.api.endusers.createOne({ email: `items_${RAND()}@test.tellescope.com` })
|
|
55
|
+
const enduserSDK = new EnduserSession({ host, businessId })
|
|
56
|
+
await authenticate_enduser_via_token(sdk, enduserSDK, { id: enduser.id })
|
|
57
|
+
|
|
58
|
+
// returns the error message for a rejected request, or '' when the request succeeded
|
|
59
|
+
const errorFor = async (session: typeof sdk | typeof enduserSDK, args: any): Promise<string> => {
|
|
60
|
+
try {
|
|
61
|
+
await (session.api.products.prepare_stripe_checkout as any)(args)
|
|
62
|
+
return ''
|
|
63
|
+
} catch (err: any) {
|
|
64
|
+
return typeof err === 'string' ? err : (err?.message ?? JSON.stringify(err))
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ---- raw Stripe price ids are staff / API-key only ----
|
|
69
|
+
const enduserRawPrice = await errorFor(enduserSDK, { items: [{ stripePriceId: 'price_raw', quantity: 1 }] })
|
|
70
|
+
record(
|
|
71
|
+
'an enduser naming a raw stripePriceId is rejected',
|
|
72
|
+
enduserRawPrice === ENDUSER_RAW_IDS_MESSAGE,
|
|
73
|
+
`expected "${ENDUSER_RAW_IDS_MESSAGE}", got "${enduserRawPrice}"`,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
const enduserRawSubscription = await errorFor(enduserSDK, { items: [{ subscriptionPriceId: 'price_sub', quantity: 1 }] })
|
|
77
|
+
record(
|
|
78
|
+
'an enduser naming a raw subscriptionPriceId is rejected',
|
|
79
|
+
enduserRawSubscription === ENDUSER_RAW_IDS_MESSAGE,
|
|
80
|
+
`expected "${ENDUSER_RAW_IDS_MESSAGE}", got "${enduserRawSubscription}"`,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
// the rejection is about raw Stripe ids, not about items: a patient can still buy a Tellescope
|
|
84
|
+
// product at a quantity, and only runs out of road at the missing Stripe account
|
|
85
|
+
const enduserProduct = await errorFor(enduserSDK, { items: [{ productId: product.id, quantity: 2 }] })
|
|
86
|
+
record(
|
|
87
|
+
'an enduser naming a Tellescope productId is allowed through the guard',
|
|
88
|
+
enduserProduct === NO_STRIPE_MESSAGE,
|
|
89
|
+
`expected "${NO_STRIPE_MESSAGE}", got "${enduserProduct}"`,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
// the same raw price from a staff session passes the guard
|
|
93
|
+
const userRawPrice = await errorFor(sdk, { items: [{ stripePriceId: 'price_raw', quantity: 1 }] })
|
|
94
|
+
record(
|
|
95
|
+
'a user session naming a raw stripePriceId is allowed through the guard',
|
|
96
|
+
userRawPrice === NO_STRIPE_MESSAGE,
|
|
97
|
+
`expected "${NO_STRIPE_MESSAGE}", got "${userRawPrice}"`,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
// ---- productIds and items are mutually exclusive ----
|
|
101
|
+
const both = await errorFor(sdk, { productIds: [product.id], items: [{ productId: product.id, quantity: 1 }] })
|
|
102
|
+
record(
|
|
103
|
+
'passing both productIds and items is rejected',
|
|
104
|
+
both === "Pass either productIds or items, not both",
|
|
105
|
+
`expected the "not both" message, got "${both}"`,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
const neither = await errorFor(sdk, {})
|
|
109
|
+
record(
|
|
110
|
+
'passing neither productIds nor items is rejected',
|
|
111
|
+
neither === "One of productIds or items is required",
|
|
112
|
+
`expected the "one of" message, got "${neither}"`,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
// ---- per-entry shape ----
|
|
116
|
+
const noId = await errorFor(sdk, { items: [{ quantity: 1 }] })
|
|
117
|
+
record(
|
|
118
|
+
'an items entry naming no id is rejected',
|
|
119
|
+
noId === EXACTLY_ONE_ID_MESSAGE,
|
|
120
|
+
`expected the "exactly one" message, got "${noId}"`,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
const twoIds = await errorFor(sdk, { items: [{ productId: product.id, stripePriceId: 'price_raw', quantity: 1 }] })
|
|
124
|
+
record(
|
|
125
|
+
'an items entry naming two ids is rejected',
|
|
126
|
+
twoIds === EXACTLY_ONE_ID_MESSAGE,
|
|
127
|
+
`expected the "exactly one" message, got "${twoIds}"`,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
// unlike productIds, which silently drops ids it cannot find, items rejects the whole cart
|
|
131
|
+
const unknownId = '60398b0231a295e64f084fd9'
|
|
132
|
+
const unknown = await errorFor(sdk, { items: [{ productId: unknownId, quantity: 1 }] })
|
|
133
|
+
record(
|
|
134
|
+
'an items entry naming an unknown productId is rejected, naming the id',
|
|
135
|
+
unknown.includes(unknownId) && unknown.includes('No product found'),
|
|
136
|
+
`expected a "No product found for productId ${unknownId}", got "${unknown}"`,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
// ---- quantity must be a whole number of at least 1 ----
|
|
140
|
+
// quantity: 0 is the one that nearly got away: build_validator returns 0 early for any isNumber
|
|
141
|
+
// field, so the schema validator cannot reject it and the guard in resolve_checkout_items is
|
|
142
|
+
// the only thing between a zero quantity and a Stripe line item
|
|
143
|
+
for (const quantity of [0, -1, 1.5]) {
|
|
144
|
+
const message = await errorFor(sdk, { items: [{ productId: product.id, quantity }] })
|
|
145
|
+
record(
|
|
146
|
+
`quantity ${quantity} is rejected`,
|
|
147
|
+
message.includes(QUANTITY_MESSAGE),
|
|
148
|
+
`expected a message containing "${QUANTITY_MESSAGE}", got "${message}"`,
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// a productIds-only request still reaches the Stripe lookup exactly as before
|
|
153
|
+
const productIdsOnly = await errorFor(sdk, { productIds: [product.id] })
|
|
154
|
+
record(
|
|
155
|
+
'a productIds-only request is unaffected',
|
|
156
|
+
productIdsOnly === NO_STRIPE_MESSAGE,
|
|
157
|
+
`expected "${NO_STRIPE_MESSAGE}", got "${productIdsOnly}"`,
|
|
158
|
+
)
|
|
159
|
+
} finally {
|
|
160
|
+
// teardown before anything asserts — assert calls process.exit, which skips pending finallys
|
|
161
|
+
if (tenant) { try { await tenant.teardown() } catch (e) { console.error('teardown failed', e) } }
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return checks
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export const stripe_checkout_items_tests = async () => {
|
|
168
|
+
assert_checks('prepare_stripe_checkout items guards', await stripe_checkout_items_checks())
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
172
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'prepare_stripe_checkout items guards', run: stripe_checkout_items_checks }
|
|
173
|
+
|
|
174
|
+
// Allow running this test file independently
|
|
175
|
+
if (require.main === module) {
|
|
176
|
+
console.log(`🌐 Using API URL: ${host}`)
|
|
177
|
+
stripe_checkout_items_tests()
|
|
178
|
+
.then(() => {
|
|
179
|
+
console.log("✅ stripe_checkout_items test suite completed successfully")
|
|
180
|
+
process.exit(0)
|
|
181
|
+
})
|
|
182
|
+
.catch((error) => {
|
|
183
|
+
console.error("❌ stripe_checkout_items test suite failed:", error)
|
|
184
|
+
process.exit(1)
|
|
185
|
+
})
|
|
186
|
+
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
assert_checks,
|
|
6
6
|
Check,
|
|
7
7
|
setup_isolated_tenant,
|
|
8
|
+
IsolatedSuite,
|
|
8
9
|
} from "../setup_isolated"
|
|
9
10
|
|
|
10
11
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
@@ -264,6 +265,9 @@ export const tickets_bulk_assign_from_queue_tests = async () => {
|
|
|
264
265
|
assert_checks('Tickets bulk assign from queue', await tickets_bulk_assign_from_queue_checks())
|
|
265
266
|
}
|
|
266
267
|
|
|
268
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
269
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'Tickets bulk assign from queue', run: tickets_bulk_assign_from_queue_checks }
|
|
270
|
+
|
|
267
271
|
// Allow running this test file independently
|
|
268
272
|
if (require.main === module) {
|
|
269
273
|
console.log(`🌐 Using API URL: ${host}`)
|
|
@@ -302,11 +302,16 @@ export const totp_mfa_tests = async ({ sdk, sdkNonAdmin } : { sdk: Session, sdkN
|
|
|
302
302
|
// the already-configured email method must keep working (no lockout)
|
|
303
303
|
await set_allowed_mfa_methods(['authenticator'])
|
|
304
304
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
305
|
+
// a successful challenge really emails the code, so only send it to a do-not-send address
|
|
306
|
+
if (NON_ADMIN_EMAIL.startsWith('dontsend') && NON_ADMIN_EMAIL.endsWith('@tellescope.com')) {
|
|
307
|
+
await async_test(
|
|
308
|
+
'E5. grace: configured email challenge still works after restriction',
|
|
309
|
+
() => sdkNonAdmin.api.users.generate_MFA_challenge({ method: 'email' }),
|
|
310
|
+
{ shouldError: false, onResult: () => true }
|
|
311
|
+
)
|
|
312
|
+
} else {
|
|
313
|
+
console.log(' E5 skipped: NON_ADMIN_EMAIL is not a dontsend address, a challenge would send a real email')
|
|
314
|
+
}
|
|
310
315
|
|
|
311
316
|
// cleanup E: clear restriction + disable email
|
|
312
317
|
await clear_allowed_mfa_methods()
|
|
@@ -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
|
|
@@ -330,6 +331,9 @@ export const trigger_contains_matching_tests = async () => {
|
|
|
330
331
|
assert_checks('Trigger contains title matching', await trigger_contains_matching_checks())
|
|
331
332
|
}
|
|
332
333
|
|
|
334
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
335
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'Trigger contains title matching', run: trigger_contains_matching_checks }
|
|
336
|
+
|
|
333
337
|
// Allow running this test file independently
|
|
334
338
|
if (require.main === module) {
|
|
335
339
|
console.log(`🌐 Using API URL: ${host}`)
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
assert_checks,
|
|
6
6
|
Check,
|
|
7
7
|
setup_isolated_tenant,
|
|
8
|
+
IsolatedSuite,
|
|
8
9
|
} from "../setup_isolated"
|
|
9
10
|
|
|
10
11
|
const host = process.env.API_URL || 'http://localhost:8080' as const
|
|
@@ -400,6 +401,9 @@ export const user_logs_restore_deleted_tests = async () => {
|
|
|
400
401
|
assert_checks('user_logs restore_deleted', await user_logs_restore_deleted_checks())
|
|
401
402
|
}
|
|
402
403
|
|
|
404
|
+
/** Enrolls this suite in the auto-discovered parallel pool — see run_discovered_isolated_suites. */
|
|
405
|
+
export const ISOLATED_SUITE: IsolatedSuite = { name: 'user_logs restore_deleted', run: user_logs_restore_deleted_checks }
|
|
406
|
+
|
|
403
407
|
// Allow running this test file independently
|
|
404
408
|
if (require.main === module) {
|
|
405
409
|
console.log(`🌐 Using API URL: ${host}`)
|