diff --git a/CHANGELOG.md b/CHANGELOG.md index 448d0e0..e4b715f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.1.1 (2026-11-29) + +- Insights Hub "monitor all numbers" is never switched on. `provision_seat_customer` used to set `monitor_all_numbers` to true; it now leaves it off and switches it off where an earlier run switched it on. Insights Hub covers the lines listed for the location, which `add_frontline_user` already adds. Re-run `provision_seat_customer` for customers set up with 0.1.0. + ## 0.1.0: Base Intelligence Seat manager lines (2026-11-18) - On the Base Intelligence Seat a manager's own phone line is not captured. `add_manager(customer, user, *, activate_alerts=True)` no longer takes `own_extension` (`activate_alerts` is keyword-only, so an extension passed positionally raises `TypeError`): a manager is mapped to exactly the end-user lines at the location, and their own extension is never mapped, nor added to First Alert or Insights Hub. diff --git a/README.md b/README.md index 0f0beb0..15da0f1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Python client for the Intelligence Cloud partner API. It covers both jobs: - **Customer lifecycle** with admin credentials (a reseller admin login): companies, locations, users, products, connectors, First Alert, Insights Hub, and the Base Intelligence Seat workflows. - **Conversation intelligence** with frontline credentials (a frontline user login): calls, transcripts, recordings, alerts, tasks, insights, and the After Call webhook. -Version 0.1.0. Python 3.10 or later. One dependency: `httpx` (0.27 or later). +Version 0.1.1. Python 3.10 or later. One dependency: `httpx` (0.27 or later). The API reference is at https://docs.intelligence.cloud/reference.html, built from https://docs.intelligence.cloud/openapi.yaml. diff --git a/pyproject.toml b/pyproject.toml index c073057..9517191 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "intelligence-cloud" -version = "0.1.0" +version = "0.1.1" description = "Python client for the Intelligence Cloud partner API: customer lifecycle and conversation intelligence." readme = "README.md" requires-python = ">=3.10" diff --git a/src/intelligence_cloud/_version.py b/src/intelligence_cloud/_version.py index 3dc1f76..485f44a 100644 --- a/src/intelligence_cloud/_version.py +++ b/src/intelligence_cloud/_version.py @@ -1 +1 @@ -__version__ = "0.1.0" +__version__ = "0.1.1" diff --git a/src/intelligence_cloud/workflows.py b/src/intelligence_cloud/workflows.py index 162c9fa..2a5dcf3 100644 --- a/src/intelligence_cloud/workflows.py +++ b/src/intelligence_cloud/workflows.py @@ -272,7 +272,7 @@ def provision_seat_customer(self, spec: SeatCustomerSpec) -> SeatCustomer: if spec.connector is not None: self._ensure_connector(location_id, spec, result) - # 7. Insights Hub: group access + every call at the location + # 7. Insights Hub: group access; only the listed lines are covered ("monitor all numbers" stays off) setup = unwrap(c.insights_hub.get_insights_hub_setup(location_id)) or {} access = setup.get("group_access") or [] if result.insights_hub_group_id not in access: @@ -282,8 +282,8 @@ def provision_seat_customer(self, spec: SeatCustomerSpec) -> SeatCustomer: else: c.insights_hub.add_groups(location_id, [result.insights_hub_group_id]) cfg = unwrap(c.insights_hub.get_insights_hub_config(location_id)) or {} - if not cfg.get("monitor_all_numbers"): - c.insights_hub.update_insights_hub_config(location_id, {"monitor_all_numbers": True}) + if cfg.get("monitor_all_numbers"): + c.insights_hub.update_insights_hub_config(location_id, {"monitor_all_numbers": False}) # 8. SSO domain claim (optional): the customer publishes the TXT record, then verify if spec.sso_domain: diff --git a/tests/live/test_live.py b/tests/live/test_live.py index cc5ffd4..e376424 100644 --- a/tests/live/test_live.py +++ b/tests/live/test_live.py @@ -221,7 +221,7 @@ def test_provision_seat_customer(admin, customer): assert [g["id"] for g in threat["groups"]] == [customer.manager_alerts_group_id] setup = unwrap(admin.insights_hub.get_insights_hub_setup(customer.location_id)) assert customer.insights_hub_group_id in setup["group_access"] - assert unwrap(admin.insights_hub.get_insights_hub_config(customer.location_id))["monitor_all_numbers"] is True + assert unwrap(admin.insights_hub.get_insights_hub_config(customer.location_id))["monitor_all_numbers"] is False raw_keys(admin, "getConnector", {"locationId": customer.location_id, "connectorId": customer.connector_id}) raw_keys(admin, "getCompany", {"companyId": customer.company_id}) diff --git a/tests/unit/test_workflows.py b/tests/unit/test_workflows.py index 3eadc76..d27aef5 100644 --- a/tests/unit/test_workflows.py +++ b/tests/unit/test_workflows.py @@ -48,7 +48,7 @@ def test_provision_call_sequence(api): ("POST", r"/resellers/[^/]+/companies"), ("PATCH", r"/companies/[^/]+"), ("POST", r"/companies/[^/]+/locations"), ("POST", r"/locations/[^/]+/user-groups"), ("POST", r"/locations/[^/]+/first-alert/rules"), ("POST", r"/locations/[^/]+/connectors"), - ("POST", r"/locations/[^/]+/insights-hub/setup"), ("PATCH", r"/locations/[^/]+/insights-hub/config"), + ("POST", r"/locations/[^/]+/insights-hub/setup"), ("POST", r"/companies/[^/]+/domains"), ] import re @@ -72,7 +72,8 @@ def test_provision_call_sequence(api): assert api.count("PATCH", r"/locations/[^/]+/first-alert/rules/[^/]+") == 0 assert all(r["groups"] == [{"id": cust.manager_alerts_group_id}] for r in rules.values()) assert api.ih_setup[cust.location_id]["group_access"] == [cust.insights_hub_group_id] - assert api.ih_config[cust.location_id] is True + assert api.ih_config.get(cust.location_id, False) is False # "monitor all numbers" stays off + assert api.count("PATCH", r"/locations/[^/]+/insights-hub/config") == 0 assert cust.connector_status == "active" and cust.connector_id assert cust.sso_txt_record == {"name": "_ic-verify.riverbend.example.com", "value": "abc"} assert "company" in cust.created and not cust.existing @@ -82,6 +83,12 @@ def test_provision_call_sequence(api): "enabled_products"} +def test_rerun_switches_monitor_all_off(api, customer): + api.ih_config[customer.location_id] = True # as a 0.1.0 run left it + api.client().workflows.provision_seat_customer(spec()) + assert api.ih_config[customer.location_id] is False + + def test_provision_is_idempotent(api, customer): before = len(api.calls) again = api.client().workflows.provision_seat_customer(spec())