Skip to content

Commit b56b67f

Browse files
authored
Merge pull request #5 from sentdm/release-please--branches--main--changes--next--components--sentdm
release: 0.1.0
2 parents 0cf8ddd + e99d7aa commit b56b67f

30 files changed

Lines changed: 297 additions & 222 deletions

.github/workflows/publish-npm.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/sentdm/sent-dm-typescript/actions/workflows/publish-npm.yml
4+
name: Publish NPM
5+
on:
6+
workflow_dispatch:
7+
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v6
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '20'
23+
24+
- name: Set up pnpm
25+
uses: pnpm/action-setup@v4
26+
27+
- name: Install dependencies
28+
run: |
29+
pnpm install
30+
31+
- name: Publish to NPM
32+
run: |
33+
bash ./bin/publish-npm
34+
env:
35+
NPM_TOKEN: ${{ secrets.SENT_DM_NPM_TOKEN || secrets.NPM_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ jobs:
1717
- name: Check release environment
1818
run: |
1919
bash ./bin/check-release-environment
20+
env:
21+
NPM_TOKEN: ${{ secrets.SENT_DM_NPM_TOKEN || secrets.NPM_TOKEN }}
2022

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.0.2"
2+
".": "0.1.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 19
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-fb283b0282d8115510162d29245bfd0675d14efaade908f6d9289aa10c841be7.yml
3-
openapi_spec_hash: aef4eefbcccbb9301feaca95070f2181
4-
config_hash: 37152ed2d55a206f1b8110620f1d42fd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-37465954227cd4e96920805a44aa6cf9a51da1f0073be89bbcb69cf32ef6cf22.yml
3+
openapi_spec_hash: 145f3fc12cd69c9f6799ded0f10c6ad3
4+
config_hash: 56966cd0f66591925f8fd02ad6808fb0

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Changelog
22

3+
## 0.1.0 (2026-01-27)
4+
5+
Full Changelog: [v0.0.2...v0.1.0](https://github.com/sentdm/sent-dm-typescript/compare/v0.0.2...v0.1.0)
6+
7+
### Features
8+
9+
* **api:** api update ([90af63d](https://github.com/sentdm/sent-dm-typescript/commit/90af63def1b37c62cd10d818db86835eaa64e3cf))
10+
* **api:** api update ([3c42d45](https://github.com/sentdm/sent-dm-typescript/commit/3c42d45342ead25067d7d07660332bfee2588261))
11+
* **api:** api update ([6bcd93b](https://github.com/sentdm/sent-dm-typescript/commit/6bcd93b49152c503583a8835efd16b0b21d4d353))
12+
* **api:** manual updates ([6afef55](https://github.com/sentdm/sent-dm-typescript/commit/6afef551585e5a32567be6237570f7faac3a28c1))
13+
* **api:** manual updates ([bb13ec3](https://github.com/sentdm/sent-dm-typescript/commit/bb13ec38564a88ab10f355310d517fee4063bc5b))
14+
* **api:** manual updates ([409a82f](https://github.com/sentdm/sent-dm-typescript/commit/409a82f1b482acd42483ca2f2cf0d0476bb858d6))
15+
* **api:** manual updates ([453d073](https://github.com/sentdm/sent-dm-typescript/commit/453d073a13c4e3249284a5f7a86227bf16a7d5b1))
16+
* **api:** manual updates ([def2439](https://github.com/sentdm/sent-dm-typescript/commit/def2439e2765ff44f9b33e5569bf95db85981bb5))
17+
* **api:** manual updates ([e1026b2](https://github.com/sentdm/sent-dm-typescript/commit/e1026b220ac28c5c5342a89ce24dcaba45a99630))
18+
19+
20+
### Chores
21+
22+
* update SDK settings ([7e0f5e5](https://github.com/sentdm/sent-dm-typescript/commit/7e0f5e54dfef8fbb28e7621da1a1ae33722a0252))
23+
* update SDK settings ([a380082](https://github.com/sentdm/sent-dm-typescript/commit/a3800828e740feb6530b127940a9fd4180b19b20))
24+
* update SDK settings ([71675f9](https://github.com/sentdm/sent-dm-typescript/commit/71675f9ee4d99832f05aa3ed43866e5886d05505))
25+
326
## 0.0.2 (2026-01-26)
427

528
Full Changelog: [v0.0.1...v0.0.2](https://github.com/sentdm/sent-dm-typescript/compare/v0.0.1...v0.0.2)

CONTRIBUTING.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ $ cd sent-dm-typescript
5555
# With yarn
5656
$ yarn link
5757
$ cd ../my-package
58-
$ yarn link sent-dm
58+
$ yarn link sentdm
5959

6060
# With pnpm
6161
$ pnpm link --global
6262
$ cd ../my-package
63-
$ pnpm link -—global sent-dm
63+
$ pnpm link -—global sentdm
6464
```
6565

6666
## Running tests
@@ -91,3 +91,17 @@ To format and fix all lint issues automatically:
9191
```sh
9292
$ pnpm fix
9393
```
94+
95+
## Publishing and releases
96+
97+
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
98+
the changes aren't made through the automated pipeline, you may want to make releases manually.
99+
100+
### Publish with a GitHub workflow
101+
102+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/sentdm/sent-dm-typescript/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
103+
104+
### Publish manually
105+
106+
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
107+
the environment.

README.md

Lines changed: 66 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sent Dm TypeScript API Library
22

3-
[![NPM version](<https://img.shields.io/npm/v/sent-dm.svg?label=npm%20(stable)>)](https://npmjs.org/package/sent-dm) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/sent-dm)
3+
[![NPM version](<https://img.shields.io/npm/v/sentdm.svg?label=npm%20(stable)>)](https://npmjs.org/package/sentdm) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/sentdm)
44

55
This library provides convenient access to the Sent Dm REST API from server-side TypeScript or JavaScript.
66

@@ -11,25 +11,27 @@ It is generated with [Stainless](https://www.stainless.com/).
1111
## Installation
1212

1313
```sh
14-
npm install git+ssh://git@github.com:sentdm/sent-dm-typescript.git
14+
npm install sentdm
1515
```
1616

17-
> [!NOTE]
18-
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npm install sent-dm`
19-
2017
## Usage
2118

2219
The full API of this library can be found in [api.md](api.md).
2320

2421
<!-- prettier-ignore -->
2522
```js
26-
import SentDm from 'sent-dm';
23+
import SentDm from 'sentdm';
2724

2825
const client = new SentDm({
29-
customerAuthScheme: process.env['SENT_DM_CUSTOMER_AUTH_SCHEME'], // This is the default and can be omitted
26+
apiKey: process.env['SENT_DM_API_KEY'], // This is the default and can be omitted
27+
senderID: process.env['SENT_DM_SENDER_ID'], // This is the default and can be omitted
3028
});
3129

32-
await client.templates.delete('REPLACE_ME');
30+
await client.messages.sendToPhone({
31+
phoneNumber: '+1234567890',
32+
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
33+
templateVariables: { name: 'John Doe', order_id: '12345' },
34+
});
3335
```
3436

3537
### Request & Response types
@@ -38,13 +40,19 @@ This library includes TypeScript definitions for all request params and response
3840

3941
<!-- prettier-ignore -->
4042
```ts
41-
import SentDm from 'sent-dm';
43+
import SentDm from 'sentdm';
4244

4345
const client = new SentDm({
44-
customerAuthScheme: process.env['SENT_DM_CUSTOMER_AUTH_SCHEME'], // This is the default and can be omitted
46+
apiKey: process.env['SENT_DM_API_KEY'], // This is the default and can be omitted
47+
senderID: process.env['SENT_DM_SENDER_ID'], // This is the default and can be omitted
4548
});
4649

47-
await client.templates.delete('REPLACE_ME');
50+
const params: SentDm.MessageSendToPhoneParams = {
51+
phoneNumber: '+1234567890',
52+
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
53+
templateVariables: { name: 'John Doe', order_id: '12345' },
54+
};
55+
await client.messages.sendToPhone(params);
4856
```
4957

5058
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -57,15 +65,21 @@ a subclass of `APIError` will be thrown:
5765

5866
<!-- prettier-ignore -->
5967
```ts
60-
const response = await client.templates.delete('REPLACE_ME').catch(async (err) => {
61-
if (err instanceof SentDm.APIError) {
62-
console.log(err.status); // 400
63-
console.log(err.name); // BadRequestError
64-
console.log(err.headers); // {server: 'nginx', ...}
65-
} else {
66-
throw err;
67-
}
68-
});
68+
const response = await client.messages
69+
.sendToPhone({
70+
phoneNumber: '+1234567890',
71+
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
72+
templateVariables: { name: 'John Doe', order_id: '12345' },
73+
})
74+
.catch(async (err) => {
75+
if (err instanceof SentDm.APIError) {
76+
console.log(err.status); // 400
77+
console.log(err.name); // BadRequestError
78+
console.log(err.headers); // {server: 'nginx', ...}
79+
} else {
80+
throw err;
81+
}
82+
});
6983
```
7084

7185
Error codes are as follows:
@@ -97,7 +111,11 @@ const client = new SentDm({
97111
});
98112

99113
// Or, configure per-request:
100-
await client.templates.delete('REPLACE_ME', {
114+
await client.messages.sendToPhone({
115+
phoneNumber: '+1234567890',
116+
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
117+
templateVariables: { name: 'John Doe', order_id: '12345' },
118+
}, {
101119
maxRetries: 5,
102120
});
103121
```
@@ -114,7 +132,11 @@ const client = new SentDm({
114132
});
115133

116134
// Override per-request:
117-
await client.templates.delete('REPLACE_ME', {
135+
await client.messages.sendToPhone({
136+
phoneNumber: '+1234567890',
137+
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
138+
templateVariables: { name: 'John Doe', order_id: '12345' },
139+
}, {
118140
timeout: 5 * 1000,
119141
});
120142
```
@@ -137,11 +159,23 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
137159
```ts
138160
const client = new SentDm();
139161

140-
const response = await client.templates.delete('REPLACE_ME').asResponse();
162+
const response = await client.messages
163+
.sendToPhone({
164+
phoneNumber: '+1234567890',
165+
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
166+
templateVariables: { name: 'John Doe', order_id: '12345' },
167+
})
168+
.asResponse();
141169
console.log(response.headers.get('X-My-Header'));
142170
console.log(response.statusText); // access the underlying Response object
143171

144-
const { data: result, response: raw } = await client.templates.delete('REPLACE_ME').withResponse();
172+
const { data: result, response: raw } = await client.messages
173+
.sendToPhone({
174+
phoneNumber: '+1234567890',
175+
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
176+
templateVariables: { name: 'John Doe', order_id: '12345' },
177+
})
178+
.withResponse();
145179
console.log(raw.headers.get('X-My-Header'));
146180
console.log(result);
147181
```
@@ -160,7 +194,7 @@ The log level can be configured in two ways:
160194
2. Using the `logLevel` client option (overrides the environment variable if set)
161195

162196
```ts
163-
import SentDm from 'sent-dm';
197+
import SentDm from 'sentdm';
164198

165199
const client = new SentDm({
166200
logLevel: 'debug', // Show all log messages
@@ -188,7 +222,7 @@ When providing a custom logger, the `logLevel` option still controls which messa
188222
below the configured level will not be sent to your logger.
189223

190224
```ts
191-
import SentDm from 'sent-dm';
225+
import SentDm from 'sentdm';
192226
import pino from 'pino';
193227

194228
const logger = pino();
@@ -223,7 +257,7 @@ parameter. This library doesn't validate at runtime that the request matches the
223257
send will be sent as-is.
224258

225259
```ts
226-
client.templates.delete({
260+
client.messages.sendToPhone({
227261
// ...
228262
// @ts-expect-error baz is not yet public
229263
baz: 'undocumented option',
@@ -257,7 +291,7 @@ globalThis.fetch = fetch;
257291
Or pass it to the client:
258292

259293
```ts
260-
import SentDm from 'sent-dm';
294+
import SentDm from 'sentdm';
261295
import fetch from 'my-fetch';
262296

263297
const client = new SentDm({ fetch });
@@ -268,7 +302,7 @@ const client = new SentDm({ fetch });
268302
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
269303

270304
```ts
271-
import SentDm from 'sent-dm';
305+
import SentDm from 'sentdm';
272306

273307
const client = new SentDm({
274308
fetchOptions: {
@@ -285,7 +319,7 @@ options to requests:
285319
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
286320

287321
```ts
288-
import SentDm from 'sent-dm';
322+
import SentDm from 'sentdm';
289323
import * as undici from 'undici';
290324

291325
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
@@ -299,7 +333,7 @@ const client = new SentDm({
299333
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
300334

301335
```ts
302-
import SentDm from 'sent-dm';
336+
import SentDm from 'sentdm';
303337

304338
const client = new SentDm({
305339
fetchOptions: {
@@ -311,7 +345,7 @@ const client = new SentDm({
311345
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
312346

313347
```ts
314-
import SentDm from 'npm:sent-dm';
348+
import SentDm from 'npm:sentdm';
315349

316350
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
317351
const client = new SentDm({

bin/check-release-environment

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
errors=()
44

5+
if [ -z "${NPM_TOKEN}" ]; then
6+
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
7+
fi
8+
59
lenErrors=${#errors[@]}
610

711
if [[ lenErrors -gt 0 ]]; then

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default tseslint.config(
2525
{
2626
patterns: [
2727
{
28-
regex: '^sent-dm(/.*)?',
28+
regex: '^sentdm(/.*)?',
2929
message: 'Use a relative import, not a package import.',
3030
},
3131
],

jest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const config: JestConfigWithTsJest = {
77
'^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }],
88
},
99
moduleNameMapper: {
10-
'^sent-dm$': '<rootDir>/src/index.ts',
11-
'^sent-dm/(.*)$': '<rootDir>/src/$1',
10+
'^sentdm$': '<rootDir>/src/index.ts',
11+
'^sentdm/(.*)$': '<rootDir>/src/$1',
1212
},
1313
modulePathIgnorePatterns: [
1414
'<rootDir>/ecosystem-tests/',

0 commit comments

Comments
 (0)