@openemail/sdk 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/index.cjs +1223 -206
- package/index.d.cts +2009 -131
- package/index.d.ts +2009 -131
- package/index.js +1210 -207
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
## Intro to the Npm Package
|
|
46
46
|
|
|
47
|
-
The official TypeScript client for the OpenEmail API.
|
|
47
|
+
The official TypeScript client for the OpenEmail API. A method for every one of the 178 endpoints, 259 in all once the paging and upload helpers are counted, typed end to end, with zero dependencies. It runs on Node 20+, Bun, Deno and Cloudflare Workers, and ships as ESM and CommonJS.
|
|
48
48
|
|
|
49
49
|
It carries a workspace API key, so it belongs on a server. The one exception is disposable inboxes, which need no key and work in a browser.
|
|
50
50
|
|
|
@@ -101,7 +101,7 @@ for await (const thread of openemail.threads.iterate({ folder: 'inbox', query: '
|
|
|
101
101
|
}
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
Every paginated resource has `list` for one page, `listAll` for every page
|
|
104
|
+
Every paginated resource has `list` for one page, `listAll` for every page at once and `iterate` to stream items and stop whenever you like. `listAll` resolves to one array, apart from `addresses.listAll`, which resolves to the whole address book.
|
|
105
105
|
|
|
106
106
|
### Errors
|
|
107
107
|
```typescript
|
|
@@ -176,8 +176,8 @@ export const openemail = new OpenEmail({
|
|
|
176
176
|
|
|
177
177
|
`createOpenEmail(options)` is the same constructor with one difference: anything you leave out is read from the environment. The shipped `openemail` takes the same options through `init(options)`, called once at startup.
|
|
178
178
|
|
|
179
|
-
`baseUrl` also comes from `OPENEMAIL_BASE_URL`, for a server you run yourself. Reads are retried on 408
|
|
179
|
+
`baseUrl` also comes from `OPENEMAIL_BASE_URL`, for a server you run yourself. Reads are retried on 408 and 5xx with backoff. A 429 is retried only when it carries a `Retry-After`, and any wait longer than a minute throws instead of sleeping. Writes that cannot safely repeat are not retried. Every method outside `tempMail` takes `{ signal, apiKey }` as its last argument, so one process can serve several workspaces with one client. The `tempMail` methods take `{ signal, inboxToken }` instead.
|
|
180
180
|
|
|
181
181
|
When a newer version is on npm the client says so once on a TTY. `OPENEMAIL_DISABLE_UPDATE_NOTICE=1` or `{ disableUpdateNotice: true }` turns that off.
|
|
182
182
|
|
|
183
|
-
Everything else, templates, rules, tracking, calendar, roles, members, settings and the full reference for
|
|
183
|
+
Everything else, templates, rules, tracking, calendar, contacts, audiences, broadcasts (`openemail.broadcasts`, which sends one personalised message to everybody in an audience), roles, members, settings, mailbox imports (`openemail.imports`, which brings a Google Takeout archive or an mbox across) and provider imports (`openemail.providerImports`, which moves a Resend account over), plus the full reference for every method, lives in the [documentation](https://openemail.uk/docs/sdk). What changed in each release is in the [changelog](https://openemail.uk/docs/sdk/changelog).
|