Collaboration Support Bot supporting my team.
Find a file
Joseph McQueen f58628e4a8 Add scripts/findEmptyLocations.js — closed-store cleanup discovery
Finds Webex Calling locations with zero PEOPLE-owned phone numbers
(the "we lost the store users, no one told us" pattern) by diffing
two paginated pulls:
  GET /v1/telephony/config/locations       → every location
  GET /v1/telephony/config/numbers         → every provisioned number
                                             with owner + location

Verdicts per location:
  - has-users           → ≥1 PEOPLE owner (excluded from report)
  - needs-cleanup-first → 0 PEOPLE but workspaces / AA / HG / etc
                          still present; needs Control Hub attention
                          before delete
  - safe-to-delete      → 0 of everything, ghost location shell

Console prints a per-location inventory table (top 20) plus a
summary. --report writes the full set to CSV with location id,
name, address, timezone, and per-owner-type counts.

--execute deletes safe-to-delete locations via
DELETE /v1/telephony/config/locations/{id}. Guarded by a mandatory
--i-am-sure flag and run serial (concurrency=1) with the shared
callWithRetry so 429/503 gets a Retry-After-aware backoff.
--limit / --offset let the operator pilot on a subset. Every
delete produces an audit line under `webex:emptyloc:audit`.

Also added a generic fetchAllPaginated helper to
scripts/lib/webexBulk.js (Link-header cursor pagination, configurable
array key) so subsequent bulk scripts can reuse it.

.gitignore: whitelisted findEmptyLocations.js; added
empty-locations-*.csv to the report-artifact ignore list.
2026-07-07 16:21:46 -04:00
commands DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
config Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
dect-relay-agent Fix DECT relay container: install node_modules at /workspace, not under agent 2026-07-03 10:15:57 -04:00
integrations Add DBS-210 status.xml parser + health verdict 2026-07-02 15:35:34 -04:00
public Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
scripts Add scripts/findEmptyLocations.js — closed-store cleanup discovery 2026-07-07 16:21:46 -04:00
services DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
tests DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
utils Add Cisco DBS-210 DECT base spike (HTTP Digest client + safe probes) 2026-07-02 15:30:42 -04:00
.dockerignore Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
.env.example DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
.gitignore Add scripts/findEmptyLocations.js — closed-store cleanup discovery 2026-07-07 16:21:46 -04:00
docker-compose.yml Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
Dockerfile Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
index.js DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
nodemon.json Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
package-lock.json DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
package.json Rework DECT relay bundle to ship a pre-built Docker image 2026-07-03 10:05:05 -04:00