v2.4.2

social

Public social engagement count endpoints backed by Disqus, sharedcount.com, and DynamoDB TTL caches.

FieldValue
Serverless servicedrive-api-social
Runtimenodejs22.x, arm64
Deployed HTTP operations4 (/social/sharecount is API Gateway ANY)
AuthPublic
OpenAPI/openapi/social.yaml · interactive

Deployed routes

FunctionMethodPathInputOutput
commentCountGET/social/commentcountQuery threadIdentifiers; optional ttl{status, threads} keyed by thread identifier
sharedCountGET/social/sharecountQuery url; optional include, ttl, apiVersion{status, hash, url, networks, shareCount, expiresAt}
sharedCountPOST/social/sharecountBody url; optional include, ttl, apiVersionSame as GET
sharedCountBulkGET/social/sharecount-bulkQuery paths; optional host, include, ttl{status, host, include, paths}

Handler-only behaviour

commentCount and sharedCountBulk contain POST parsing branches in code, but only GET routes are mounted in serverless.yml. The OpenAPI spec intentionally documents only the deployed HTTP methods for those paths.

Behaviour notes

  • commentCount calls Disqus threads/list.json; cache keys are ident:<threadIdentifier>, and status in the response is 304 when every thread came from cache.
  • sharedCount currently always calls sharedcount.com v1 even though the source contains a v2 URL constant.
  • sharedCount rejects URLs whose host does not match (drivemustang|drive).com.au.
  • sharedCountBulk takes host plus comma-separated paths; it does not accept a urls[] array. Per-path failures return shareCount: null for that path while the overall response remains 200.
  • Error paths emit CloudWatch metrics for user input, unsupported input, external origin, and DynamoDB failures.

Source map

  • Routes and caches: services/social/serverless.yml
  • Handlers: services/social/functions/commentCount.ts, services/social/functions/sharedCount.ts, services/social/functions/sharedCountBulk.ts
  • Types: services/social/types/
Esc