Skip to content

Commit 4bb2575

Browse files
chore: sync repo
1 parent b56b67f commit 4bb2575

30 files changed

Lines changed: 60 additions & 271 deletions

.github/workflows/publish-npm.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/release-doctor.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.release-please-manifest.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.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-37465954227cd4e96920805a44aa6cf9a51da1f0073be89bbcb69cf32ef6cf22.yml
3-
openapi_spec_hash: 145f3fc12cd69c9f6799ded0f10c6ad3
4-
config_hash: 56966cd0f66591925f8fd02ad6808fb0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-9bd9d3b1088033ce71a3141eedd1ae58dd0fb9c2c0001587a92f1eb2dce1dd56.yml
3+
openapi_spec_hash: c836975b96491bea1ee2d34fcc28170f
4+
config_hash: 66c415541d89a0e7a8deef56c9d84dc2

CHANGELOG.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@ If you’d like to use the repository from source, you can either install from g
4242
To install via git:
4343

4444
```sh
45-
$ npm install git+ssh://git@github.com:sentdm/sent-dm-typescript.git
45+
$ npm install git+ssh://git@github.com:stainless-sdks/sent-dm-typescript.git
4646
```
4747

4848
Alternatively, to link a local copy of the repo:
4949

5050
```sh
5151
# Clone
52-
$ git clone https://www.github.com/sentdm/sent-dm-typescript
52+
$ git clone https://www.github.com/stainless-sdks/sent-dm-typescript
5353
$ cd sent-dm-typescript
5454

5555
# With yarn
5656
$ yarn link
5757
$ cd ../my-package
58-
$ yarn link sentdm
58+
$ yarn link sent-dm
5959

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

6666
## Running tests
@@ -91,17 +91,3 @@ 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: 20 additions & 39 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/sentdm.svg?label=npm%20(stable)>)](https://npmjs.org/package/sentdm) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/sentdm)
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)
44

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

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

1313
```sh
14-
npm install sentdm
14+
npm install git+ssh://git@github.com:stainless-sdks/sent-dm-typescript.git
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+
1720
## Usage
1821

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

2124
<!-- prettier-ignore -->
2225
```js
23-
import SentDm from 'sentdm';
26+
import SentDm from 'sent-dm';
2427

2528
const client = new SentDm({
2629
apiKey: process.env['SENT_DM_API_KEY'], // This is the default and can be omitted
@@ -30,7 +33,6 @@ const client = new SentDm({
3033
await client.messages.sendToPhone({
3134
phoneNumber: '+1234567890',
3235
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
33-
templateVariables: { name: 'John Doe', order_id: '12345' },
3436
});
3537
```
3638

@@ -40,7 +42,7 @@ This library includes TypeScript definitions for all request params and response
4042

4143
<!-- prettier-ignore -->
4244
```ts
43-
import SentDm from 'sentdm';
45+
import SentDm from 'sent-dm';
4446

4547
const client = new SentDm({
4648
apiKey: process.env['SENT_DM_API_KEY'], // This is the default and can be omitted
@@ -50,7 +52,6 @@ const client = new SentDm({
5052
const params: SentDm.MessageSendToPhoneParams = {
5153
phoneNumber: '+1234567890',
5254
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
53-
templateVariables: { name: 'John Doe', order_id: '12345' },
5455
};
5556
await client.messages.sendToPhone(params);
5657
```
@@ -66,11 +67,7 @@ a subclass of `APIError` will be thrown:
6667
<!-- prettier-ignore -->
6768
```ts
6869
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-
})
70+
.sendToPhone({ phoneNumber: '+1234567890', templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8' })
7471
.catch(async (err) => {
7572
if (err instanceof SentDm.APIError) {
7673
console.log(err.status); // 400
@@ -111,11 +108,7 @@ const client = new SentDm({
111108
});
112109

113110
// Or, configure per-request:
114-
await client.messages.sendToPhone({
115-
phoneNumber: '+1234567890',
116-
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
117-
templateVariables: { name: 'John Doe', order_id: '12345' },
118-
}, {
111+
await client.messages.sendToPhone({ phoneNumber: '+1234567890', templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8' }, {
119112
maxRetries: 5,
120113
});
121114
```
@@ -132,11 +125,7 @@ const client = new SentDm({
132125
});
133126

134127
// Override per-request:
135-
await client.messages.sendToPhone({
136-
phoneNumber: '+1234567890',
137-
templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
138-
templateVariables: { name: 'John Doe', order_id: '12345' },
139-
}, {
128+
await client.messages.sendToPhone({ phoneNumber: '+1234567890', templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8' }, {
140129
timeout: 5 * 1000,
141130
});
142131
```
@@ -160,21 +149,13 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
160149
const client = new SentDm();
161150

162151
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-
})
152+
.sendToPhone({ phoneNumber: '+1234567890', templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8' })
168153
.asResponse();
169154
console.log(response.headers.get('X-My-Header'));
170155
console.log(response.statusText); // access the underlying Response object
171156

172157
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-
})
158+
.sendToPhone({ phoneNumber: '+1234567890', templateId: '7ba7b820-9dad-11d1-80b4-00c04fd430c8' })
178159
.withResponse();
179160
console.log(raw.headers.get('X-My-Header'));
180161
console.log(result);
@@ -194,7 +175,7 @@ The log level can be configured in two ways:
194175
2. Using the `logLevel` client option (overrides the environment variable if set)
195176

196177
```ts
197-
import SentDm from 'sentdm';
178+
import SentDm from 'sent-dm';
198179

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

224205
```ts
225-
import SentDm from 'sentdm';
206+
import SentDm from 'sent-dm';
226207
import pino from 'pino';
227208

228209
const logger = pino();
@@ -291,7 +272,7 @@ globalThis.fetch = fetch;
291272
Or pass it to the client:
292273

293274
```ts
294-
import SentDm from 'sentdm';
275+
import SentDm from 'sent-dm';
295276
import fetch from 'my-fetch';
296277

297278
const client = new SentDm({ fetch });
@@ -302,7 +283,7 @@ const client = new SentDm({ fetch });
302283
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.)
303284

304285
```ts
305-
import SentDm from 'sentdm';
286+
import SentDm from 'sent-dm';
306287

307288
const client = new SentDm({
308289
fetchOptions: {
@@ -319,7 +300,7 @@ options to requests:
319300
<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>
320301

321302
```ts
322-
import SentDm from 'sentdm';
303+
import SentDm from 'sent-dm';
323304
import * as undici from 'undici';
324305

325306
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
@@ -333,7 +314,7 @@ const client = new SentDm({
333314
<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>
334315

335316
```ts
336-
import SentDm from 'sentdm';
317+
import SentDm from 'sent-dm';
337318

338319
const client = new SentDm({
339320
fetchOptions: {
@@ -345,7 +326,7 @@ const client = new SentDm({
345326
<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>
346327

347328
```ts
348-
import SentDm from 'npm:sentdm';
329+
import SentDm from 'npm:sent-dm';
349330

350331
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
351332
const client = new SentDm({
@@ -367,7 +348,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
367348

368349
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
369350

370-
We are keen for your feedback; please open an [issue](https://www.github.com/sentdm/sent-dm-typescript/issues) with questions, bugs, or suggestions.
351+
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/sent-dm-typescript/issues) with questions, bugs, or suggestions.
371352

372353
## Requirements
373354

bin/check-release-environment

Lines changed: 0 additions & 22 deletions
This file was deleted.

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: '^sentdm(/.*)?',
28+
regex: '^sent-dm(/.*)?',
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-
'^sentdm$': '<rootDir>/src/index.ts',
11-
'^sentdm/(.*)$': '<rootDir>/src/$1',
10+
'^sent-dm$': '<rootDir>/src/index.ts',
11+
'^sent-dm/(.*)$': '<rootDir>/src/$1',
1212
},
1313
modulePathIgnorePatterns: [
1414
'<rootDir>/ecosystem-tests/',

0 commit comments

Comments
 (0)