Skip to content

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 11 May 00:24
· 68 commits to main since this release

Added

  • Redis and Postgres Storage adapters at subpath exports.
    • @dojocoding/whatsapp/storage/redis exports
      createRedisStorage(client, options?). Takes an
      ioredis-compatible client; uses native SET PX / SET NX
      for TTL and atomicity. ioredis is an optional peer
      dependency on ^5.0.0.
    • @dojocoding/whatsapp/storage/postgres exports
      createPostgresStorage(client, options?) and
      POSTGRES_STORAGE_SCHEMA: string. Takes a pg-compatible
      client; runs four SQL statements (SELECT, two INSERT ... ON CONFLICT, DELETE). pg is an optional peer dependency on
      ^8.0.0.
    • Both adapters use minimal structural interfaces (RedisLike,
      PgLike) so the SDK doesn't import either library at runtime;
      consumers pass any compatible client (including test fakes).
    • See docs/storage.md.
  • Shared Storage contract test:
    test/unit/storage/contract.ts exports a parametrised suite
    that every implementation (InMemoryStorage,
    createRedisStorage, createPostgresStorage) runs against —
    drift between implementations is impossible-to-not-notice.