src/lib/servicetitan/client.ts
api gatedToken handling, base URLs, ST-App-Key headers, timeout, retry, and ServiceTitan error classification.
Current: API readiness pack and connection readiness matrix.
Do not implement live requests until app credentials, scopes, sandbox access, and secret storage are approved.
src/lib/servicetitan/repo.ts
database gatedPrivate persistence for connections, taxonomy, bindings, syncs, webhook events, drift findings, and outcomes.
Current: Typed static packets under src/lib/servicetitan.
Requires migrations, row-level access rules, retention policy, and tests against real persistence.
src/lib/servicetitan/map.ts
offline modeledMap PageToJob leads, booking envelopes, source context, and Titan Map bindings to future ServiceTitan payload candidates.
Current: Booking foundation, source context, handoff simulator, and Titan Map workbench.
Payload writes remain disabled until customer mapping validation and endpoint eligibility are proven.
src/lib/servicetitan/taxonomy.ts
offline modeledNormalize job types, business units, campaigns, zones, memberships, and pricebook items from manual exports or future APIs.
Current: Manual taxonomy importer.
Read-only API import requires approved scopes and customer module eligibility.
src/lib/servicetitan/verify.ts
api gatedWebhook signature verification, replay protection, raw body handling, and event deduplication.
Current: API readiness and marketplace webhook requirements.
Requires ServiceTitan webhook signing details and sandbox validation.
src/worker/servicetitan-jobs.ts
database gatedProcess taxonomy imports, sync queue jobs, outcome matching, drift checks, retries, and disconnect cleanup outside public requests.
Current: Sync queue, drift report, importer, outcome report, and support runbooks.
Requires durable queue tables, idempotency keys, worker scheduling, and operator-visible failure states.