Remove the deprecated SMS-Magic permission set and build an autonomous RingCentral → Litify SMS sync so every text creates a Litify Note on the matching Matter or Intake, with idempotent upserts and one-command rollback.
/Users/samaguiar/Documents/Projects/litify/ringcentral-sms-sync/.
src/rc-auth.js — RC JWT bearer auth, 20-min token cache.src/sf-auth.js — reuses local sf CLI (sf org display --target-org LITIFY_ORG --json). No Connected App, no stored SF secret. Normalizes apiVersion → v66.0.src/rc-client.js — paginates /restapi/v1.0/account/{acct}/extension/{ext}/message-store?messageType=SMS, normalizes RC record shape.src/phone-match.js — 10-digit US normalization + SOQL LIKE matcher on Matter_Phone__c, Client_Phone__c, litify_pm__Phone__c, Phone_10_Digit__c. Open matters and unconverted intakes first.src/sync.js — orchestrator with --dry-run, --backfill, --incremental, --since=, --until=, --wave=, --ext=. Writes JSON report and text log per run.src/rollback.js — deletes by External_Id__c LIKE 'rc_msg_%' with --wave, --since, --until, --owner, --ext-id filters. Dry-run default, --confirm to delete.config/sync-config.json — full wave1–wave4 roster from Sam's explicit assignments, phone field lists, Intaker filter (skips chatbot SMS), topic map, poll windows, test record ids.001UV00000kZGyjYAG (Sam Test)a0CUV00006LMO7s2AH (INT-26041554238)a0LUV00000G5NHJ2A3 (MAT-26041566490, Matter_Phone__c = (502) 813-8900)Text message sent / Text message received both write successfully without a metadata deploy. UI dropdown value add deferred (phase-2 polish).SELECT COUNT() FROM litify_pm__lit_Note__c WHERE External_Id__c LIKE 'rc_msg_%' → 915. Report: reports/sync-live-wave1_intake-2026-04-15T01-27-53-135Z.json.sf CLI instead of stored client credentials. The vault-based client-credentials flow returned no client credentials user enabled. Using sf org display means no SF secrets live in this project.External_Id__c = rc_msg_{rcMessageId} for idempotency. Re-running any window is a no-op on already-synced messages.sfUserId set where known; the sync sets OwnerId on the Note so Litify views respect record ownership.node src/rollback.js --confirm deletes every Note with External_Id__c LIKE 'rc_msg_%'. Filter by wave, owner, date, or single RC message id.001UV00000kZGyjYAG, Intake a0CUV00006LMO7s2AH, Matter a0LUV00000G5NHJ2A3./Users/samaguiar/Documents/Projects/litify/ringcentral-sms-sync/ folder is deletable.