purge
Cache purge, content transition, Manifold transition, and Slack PurgeBot entry points.
| Field | Value |
|---|
| Serverless service | drive-api-purge |
| Runtime | nodejs22.x, arm64 |
| Deployed HTTP operations | 6 |
| Queue consumers | postTransitionProcess, purgeBotProcess |
| OpenAPI | /openapi/purge.yaml · interactive |
Deployed routes
| Function | Method | Path | Auth | Input | Output |
|---|
postTransitionQueue | POST | /post/transition | API key | PostTransitionRequest | Queued or rejected transition object |
manifoldTransitionQueue | POST | /manifold/transition | API key | {scope, environment} | Batch queue result |
purgeBotQueue | POST | /purge/bot | Public | Slack slash-command form body or JSON | Slack blocks response |
purgeOrigin | POST | /purge/origin | API key | {items: string[], requestId} | purgeOriginResults[] |
purgeGraphql | POST | /purge/graphql | API key | PurgeGraphqlRequest | GraphQL purge response |
purgeEdge | POST | /purge/edge | API key | PurgeEdgeRequest | Cloudflare purge response plus optional cache-warm results |
Queue consumers
| Function | Trigger | Purpose |
|---|
postTransitionProcess | SQS | Consumes post transition messages, invokes origin/edge/GraphQL purge functions, and publishes Athena index events. |
purgeBotProcess | SQS | Consumes validated Slack PurgeBot messages and invokes origin/edge purge functions. |
Behaviour notes
postTransitionQueue validates {id, url, postType} and host allow-list. Validation failures return HTTP 200 with result: "rejected" rather than 400.
postTransitionQueue publishes SNS to the post-transition topic for downstream consumers such as cmstosocial; SNS publish failure is logged but not fatal to the queue response.
manifoldTransitionQueue reads the last ingest timestamp from DynamoDB, queries Tailpipe GraphQL for updated makes, badges, models, and variants, then batches showroom-page transitions to SQS.
purgeOrigin expects items as URL strings, not {url} objects. It calls each URL with x-purge-cache and Cloudflare Access headers.
purgeGraphql builds GraphCDN/Stellate mutation payloads from purgeType; service selects purgeEndpoint<service>.
purgeEdge maps purge types to Cloudflare payload keys: Host -> hosts, Prefix -> prefixes, Tag -> tags, Url -> files.
Source map
- Routes and queues:
services/purge/serverless.yml
- Handlers:
services/purge/functions/
- Post transition types:
services/purge/types/