-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into release-please--branches--main--changes--nex…
…t--components--sent
- Loading branch information
Showing
30 changed files
with
81 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Sent Node API Library | ||
|
||
[![NPM version](https://img.shields.io/npm/v/sent.svg)](https://npmjs.org/package/sent) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/sent) | ||
[![NPM version](https://img.shields.io/npm/v/sentdm.svg)](https://npmjs.org/package/sentdm) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/sentdm) | ||
|
||
This library provides convenient access to the Sent REST API from server-side TypeScript or JavaScript. | ||
|
||
|
@@ -11,19 +11,16 @@ It is generated with [Stainless](https://www.stainlessapi.com/). | |
## Installation | ||
|
||
```sh | ||
npm install git+ssh://[email protected]:sentdm/sent-node.git | ||
npm install sentdm | ||
``` | ||
|
||
> [!NOTE] | ||
> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install sent` | ||
## Usage | ||
|
||
The full API of this library can be found in [api.md](api.md). | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
import Sent from 'sent'; | ||
import Sent from 'sentdm'; | ||
|
||
const client = new Sent(); | ||
|
||
|
@@ -40,7 +37,7 @@ This library includes TypeScript definitions for all request params and response | |
|
||
<!-- prettier-ignore --> | ||
```ts | ||
import Sent from 'sent'; | ||
import Sent from 'sentdm'; | ||
|
||
const client = new Sent(); | ||
|
||
|
@@ -207,11 +204,11 @@ add the following import before your first import `from "Sent"`: | |
```ts | ||
// Tell TypeScript and the package to use the global web fetch instead of node-fetch. | ||
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed. | ||
import 'sent/shims/web'; | ||
import Sent from 'sent'; | ||
import 'sentdm/shims/web'; | ||
import Sent from 'sentdm'; | ||
``` | ||
|
||
To do the inverse, add `import "sent/shims/node"` (which does import polyfills). | ||
To do the inverse, add `import "sentdm/shims/node"` (which does import polyfills). | ||
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/sentdm/sent-node/tree/main/src/_shims#readme)). | ||
|
||
### Logging and middleware | ||
|
@@ -221,7 +218,7 @@ which can be used to inspect or alter the `Request` or `Response` before/after e | |
|
||
```ts | ||
import { fetch } from 'undici'; // as one example | ||
import Sent from 'sent'; | ||
import Sent from 'sentdm'; | ||
|
||
const client = new Sent({ | ||
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "sent", | ||
|
||
"name": "sentdm", | ||
"version": "0.1.0-alpha.1", | ||
"description": "The official TypeScript library for the Sent API", | ||
"author": "Sent <[email protected]>", | ||
|
@@ -60,8 +61,8 @@ | |
"./shims/web.mjs" | ||
], | ||
"imports": { | ||
"sent": ".", | ||
"sent/*": "./src/*" | ||
"sentdm": ".", | ||
"sentdm/*": "./src/*" | ||
}, | ||
"exports": { | ||
"./_shims/auto/*": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.