Ruby
Changelog
Every release of the gem, newest first.
0.0.1
The first release. It covers the whole TypeScript SDK as it stood when this release was cut, 0.0.8 plus the changes queued after it: 430 methods in 41 namespaces, each under the TypeScript name in snake_case, and every one of them sends byte for byte the request its TypeScript twin sends.
OpenEmail::Clienthas a reader for every namespace, fromemails,threadsandtemplatestoprovider_imports,dns_connectionsandaccount.listAllislist_all,getActiveisget_active, andtempMailistemp_mail.- A request body goes in as keyword arguments or as one Hash, and its keys keep the API’s camelCase names. A response comes back as a Hash with Symbol keys.
- Every paginated resource has
list, which returns oneOpenEmail::Page,list_all, which returns every item as an Array, anditerate, which yields each item to a block or returns an Enumerator that fetches the next page only when it gets there.PeoplePage,TempMessagesPage,AddressBookPage,AddressBook,BatchResultandTemplateSendscarry the answers that hold more than a list. - An API refusal raises
OpenEmail::ApiErroror its subclass for the error type, withstatus,type,code,param,doc_url,request_id,retry_after_seconds,fieldsandbody, and predicates such asvalidation?andstep_up_required?. No response at all raisesOpenEmail::NetworkError, withtimeout?when the deadline passed. A mistake in the call itself raisesArgumentErrorbefore anything is sent. OpenEmail.create_clientbuilds a client fromOPENEMAIL_API_KEY,OPENEMAIL_ACCESS_TOKENandOPENEMAIL_BASE_URL, andOpenEmail.init,OpenEmail.clientandOpenEmail.reset_clientmanage one shared client thatOpenEmail.emailsand every other namespace reach through.OpenEmail.create_temp_mailopens disposable inboxes with no credential.access_token:takes an OAuth access token, or anything that responds tocalland returns one, called before every request. Every method takesapi_key:to act with another key for one call, and thetemp_mailmethods takeinbox_token:.OpenEmail.verify_webhook_signaturechecks a delivery in constant time, refuses one more than five minutes old and returns the parsed event. It reads the signature from a Hash in any case, a Rack env or Rails’request.headers.OpenEmail.to_base64,api_key?,access_token?,sealed?,resolve_language,language_by_codeandrtl_language?are the helpers of the TypeScript SDK, and every value set its package root exports is a frozen Hash onOpenEmail.- It has no runtime dependencies. Requests go through Net::HTTP with a pool of kept-alive connections that one client shares across threads and rebuilds after a fork, and
timeout:bounds a whole attempt. - Reads, sends and every write that is safe to repeat are retried on 408, 500, 502, 503 and 504 with backoff, and on a 429 only when its
Retry-Afteris a minute or less. Every send carries an idempotency key that its retries reuse. - The client refuses to send a credential over plain
http:to anything but this machine, refuses abase_urlon0.0.0.0, refuses a header that would split a request, and never letsraw.requestleave the base URL’s origin.