Trawl SDK 1.0: jobs.create, createAndPoll, typed errors and webhook verification
@productcraft/trawl 1.0 gives every Trawl operation a method (trawl.jobs.createAndPoll() returns a typed result), with retries, automatic idempotency keys, pagination, typed errors, webhook verification and a mock fetch for tests.
npm install @productcraft/trawl now gets you trawl.jobs.create(), retrieve(), list(), cancel() and createAndPoll<T>(), which waits for the job and types result as your shape. Webhook endpoints, events and credits have methods too, and trawl.webhooks.unwrap() verifies a delivery's signature and returns a typed event.
Failures are classes you can catch (RateLimitError, NotFoundError, …) carrying the error code, request id and a link into the new error code catalogue. Retries with backoff, an idempotency key on every create and auto-pagination are built in, and @productcraft/trawl/testing answers every call from the spec for unit tests (see Testing). The Trawl docs and the API reference, which now has a Node tab per operation, use the new methods. Upgrading from 0.x: the old .client still works; the migration guide shows each call before and after.