Skip to content

Commit e1371cc

Browse files
committed
feat(api): update via SDK Studio
1 parent 28ff778 commit e1371cc

File tree

15 files changed

+212
-26
lines changed

15 files changed

+212
-26
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 13
1+
configured_endpoints: 15
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-5276b9a8b8ff6771c5bb1a8310d0be63ddafa9e4806f0d81de21dd7a7a673c1b.yml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

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

7-
The REST API documentation can be found on [sent.dm](https://sent.dm/docs). The full API of this library can be found in [api.md](api.md).
7+
The REST API documentation can be found on [www.sent.dm](https://www.sent.dm/docs). The full API of this library can be found in [api.md](api.md).
88

99
It is generated with [Stainless](https://www.stainlessapi.com/).
1010

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ or products provided by Sent please follow the respective company's security rep
2020

2121
### Sent Terms and Policies
2222

23-
Please contact dev-feedback@sent.com for any questions or concerns regarding security of our services.
23+
Please contact team@sent.dm for any questions or concerns regarding security of our services.
2424

2525
---
2626

api.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
# Shared
1+
# Contacts
22

33
Types:
44

5-
- <code><a href="./src/resources/shared.ts">SentDmServicesContractsDataContactDto</a></code>
5+
- <code><a href="./src/resources/contacts/contacts.ts">SentDmServicesContractsDataContactDto</a></code>
6+
- <code><a href="./src/resources/contacts/contacts.ts">ContactListResponse</a></code>
67

7-
# Contact
8+
Methods:
89

9-
## ID
10+
- <code title="get /contacts">client.contacts.<a href="./src/resources/contacts/contacts.ts">list</a>({ ...params }) -> unknown</code>
1011

11-
## Phone
12+
## ID
1213

13-
# Contacts
14+
Methods:
1415

15-
Types:
16+
- <code title="get /contacts/{customerId}/id/{id}">client.contacts.id.<a href="./src/resources/contacts/id.ts">retrieve</a>(customerId, id) -> SentDmServicesContractsDataContactDto</code>
1617

17-
- <code><a href="./src/resources/contacts.ts">ContactListResponse</a></code>
18+
## Phone
1819

1920
Methods:
2021

21-
- <code title="get /contacts">client.contacts.<a href="./src/resources/contacts.ts">list</a>({ ...params }) -> unknown</code>
22+
- <code title="get /contacts/{customerId}/phone/{phoneNumber}">client.contacts.phone.<a href="./src/resources/contacts/phone.ts">retrieve</a>(customerId, phoneNumber) -> SentDmServicesContractsDataContactDto</code>
2223

2324
# Messages
2425

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "sent",
33
"version": "0.0.1-alpha.0",
44
"description": "The official TypeScript library for the Sent API",
5-
"author": "Sent <dev-feedback@sent.com>",
5+
"author": "Sent <team@sent.dm>",
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",

src/index.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as API from './resources/index';
88

99
export interface ClientOptions {
1010
/**
11-
* API Key for accessing the Sent DM Core API
11+
* API key used for authenticating requests.
1212
*/
1313
apiKey?: string | undefined;
1414

@@ -81,7 +81,7 @@ export class Sent extends Core.APIClient {
8181
* API Client for interfacing with the Sent API.
8282
*
8383
* @param {string | undefined} [opts.apiKey=process.env['X_API_KEY'] ?? undefined]
84-
* @param {string} [opts.baseURL=process.env['SENT_BASE_URL'] ?? https://sent.dm] - Override the default base URL for the API.
84+
* @param {string} [opts.baseURL=process.env['SENT_BASE_URL'] ?? https://api.sent.dm] - Override the default base URL for the API.
8585
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
8686
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
8787
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -103,7 +103,7 @@ export class Sent extends Core.APIClient {
103103
const options: ClientOptions = {
104104
apiKey,
105105
...opts,
106-
baseURL: baseURL || `https://sent.dm`,
106+
baseURL: baseURL || `https://api.sent.dm`,
107107
};
108108

109109
super({
@@ -119,7 +119,6 @@ export class Sent extends Core.APIClient {
119119
this.apiKey = apiKey;
120120
}
121121

122-
contact: API.Contact = new API.Contact(this);
123122
contacts: API.Contacts = new API.Contacts(this);
124123
messages: API.Messages = new API.Messages(this);
125124
sms: API.SMS = new API.SMS(this);
@@ -185,9 +184,8 @@ export import fileFromPath = Uploads.fileFromPath;
185184
export namespace Sent {
186185
export import RequestOptions = Core.RequestOptions;
187186

188-
export import Contact = API.Contact;
189-
190187
export import Contacts = API.Contacts;
188+
export import SentDmServicesContractsDataContactDto = API.SentDmServicesContractsDataContactDto;
191189
export import ContactListResponse = API.ContactListResponse;
192190
export import ContactListParams = API.ContactListParams;
193191

@@ -219,8 +217,6 @@ export namespace Sent {
219217
export import SentDmServicesContractsDataCustomerDto = API.SentDmServicesContractsDataCustomerDto;
220218
export import CustomerDeleteResponse = API.CustomerDeleteResponse;
221219
export import CustomerUpdateParams = API.CustomerUpdateParams;
222-
223-
export import SentDmServicesContractsDataContactDto = API.SentDmServicesContractsDataContactDto;
224220
}
225221

226222
export default Sent;

src/resources/contacts/contacts.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../resource';
4+
import * as Core from '../../core';
5+
import * as ContactsAPI from './contacts';
6+
import * as SMSAPI from '../sms';
7+
import * as WhatsappAPI from '../whatsapp';
8+
import * as IDAPI from './id';
9+
import * as PhoneAPI from './phone';
10+
11+
export class Contacts extends APIResource {
12+
id: IDAPI.ID = new IDAPI.ID(this._client);
13+
phone: PhoneAPI.Phone = new PhoneAPI.Phone(this._client);
14+
15+
list(query: ContactListParams, options?: Core.RequestOptions): Core.APIPromise<unknown> {
16+
return this._client.get('/contacts', { query, ...options });
17+
}
18+
}
19+
20+
export interface SentDmServicesContractsDataContactDto {
21+
id?: string;
22+
23+
availableChannels?: string;
24+
25+
countryCode?: string;
26+
27+
createdAt?: string;
28+
29+
customerId?: string | null;
30+
31+
defaultChannel?: string;
32+
33+
nationalFormat?: string;
34+
35+
phoneNumber?: string;
36+
37+
smsPayloadDTO?: SMSAPI.SentDmServicesContractsDataSMSPayloadDto;
38+
39+
updatedAt?: string;
40+
41+
verified?: boolean;
42+
43+
whatsappPayloadDTO?: WhatsappAPI.SentDmServicesContractsDataWhatsappPayloadDto;
44+
}
45+
46+
export type ContactListResponse = unknown;
47+
48+
export interface ContactListParams {
49+
customerId: string;
50+
51+
page: number;
52+
53+
pageSize: number;
54+
}
55+
56+
export namespace Contacts {
57+
export import SentDmServicesContractsDataContactDto = ContactsAPI.SentDmServicesContractsDataContactDto;
58+
export import ContactListResponse = ContactsAPI.ContactListResponse;
59+
export import ContactListParams = ContactsAPI.ContactListParams;
60+
export import ID = IDAPI.ID;
61+
export import Phone = PhoneAPI.Phone;
62+
}

src/resources/contacts/id.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../resource';
4+
import * as Core from '../../core';
5+
import * as ContactsAPI from './contacts';
6+
7+
export class ID extends APIResource {
8+
retrieve(
9+
customerId: string,
10+
id: string,
11+
options?: Core.RequestOptions,
12+
): Core.APIPromise<ContactsAPI.SentDmServicesContractsDataContactDto> {
13+
return this._client.get(`/contacts/${customerId}/id/${id}`, options);
14+
}
15+
}

src/resources/contacts/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export { ID } from './id';
4+
export { Phone } from './phone';
5+
export {
6+
SentDmServicesContractsDataContactDto,
7+
ContactListResponse,
8+
ContactListParams,
9+
Contacts,
10+
} from './contacts';

src/resources/contacts/phone.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../resource';
4+
import * as Core from '../../core';
5+
import * as ContactsAPI from './contacts';
6+
7+
export class Phone extends APIResource {
8+
retrieve(
9+
customerId: string,
10+
phoneNumber: string,
11+
options?: Core.RequestOptions,
12+
): Core.APIPromise<ContactsAPI.SentDmServicesContractsDataContactDto> {
13+
return this._client.get(`/contacts/${customerId}/phone/${phoneNumber}`, options);
14+
}
15+
}

0 commit comments

Comments
 (0)