sendblue 2.0.2 → 3.3.0
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/CHANGELOG.md +183 -0
- package/LICENSE +1 -1
- package/README.md +34 -5
- package/client.d.mts +25 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +25 -3
- package/client.d.ts.map +1 -1
- package/client.js +41 -17
- package/client.js.map +1 -1
- package/client.mjs +41 -17
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +1 -1
- package/resources/contacts/bulk.d.mts +25 -3
- package/resources/contacts/bulk.d.mts.map +1 -1
- package/resources/contacts/bulk.d.ts +25 -3
- package/resources/contacts/bulk.d.ts.map +1 -1
- package/resources/contacts/bulk.js +3 -0
- package/resources/contacts/bulk.js.map +1 -1
- package/resources/contacts/bulk.mjs +3 -0
- package/resources/contacts/bulk.mjs.map +1 -1
- package/resources/contacts/contacts.d.mts +101 -18
- package/resources/contacts/contacts.d.mts.map +1 -1
- package/resources/contacts/contacts.d.ts +101 -18
- package/resources/contacts/contacts.d.ts.map +1 -1
- package/resources/contacts/contacts.js +5 -2
- package/resources/contacts/contacts.js.map +1 -1
- package/resources/contacts/contacts.mjs +5 -2
- package/resources/contacts/contacts.mjs.map +1 -1
- package/resources/contacts/index.d.mts +1 -1
- package/resources/contacts/index.d.mts.map +1 -1
- package/resources/contacts/index.d.ts +1 -1
- package/resources/contacts/index.d.ts.map +1 -1
- package/resources/contacts/index.js.map +1 -1
- package/resources/contacts/index.mjs.map +1 -1
- package/resources/groups.d.mts +3 -0
- package/resources/groups.d.mts.map +1 -1
- package/resources/groups.d.ts +3 -0
- package/resources/groups.d.ts.map +1 -1
- package/resources/groups.js +3 -0
- package/resources/groups.js.map +1 -1
- package/resources/groups.mjs +3 -0
- package/resources/groups.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/lookups.d.mts +3 -0
- package/resources/lookups.d.mts.map +1 -1
- package/resources/lookups.d.ts +3 -0
- package/resources/lookups.d.ts.map +1 -1
- package/resources/lookups.js +3 -0
- package/resources/lookups.js.map +1 -1
- package/resources/lookups.mjs +3 -0
- package/resources/lookups.mjs.map +1 -1
- package/resources/media-objects.d.mts +3 -0
- package/resources/media-objects.d.mts.map +1 -1
- package/resources/media-objects.d.ts +3 -0
- package/resources/media-objects.d.ts.map +1 -1
- package/resources/media-objects.js +3 -0
- package/resources/media-objects.js.map +1 -1
- package/resources/media-objects.mjs +3 -0
- package/resources/media-objects.mjs.map +1 -1
- package/resources/messages.d.mts +50 -7
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +50 -7
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +19 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +19 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/typing-indicators.d.mts +10 -2
- package/resources/typing-indicators.d.mts.map +1 -1
- package/resources/typing-indicators.d.ts +10 -2
- package/resources/typing-indicators.d.ts.map +1 -1
- package/resources/typing-indicators.js +5 -2
- package/resources/typing-indicators.js.map +1 -1
- package/resources/typing-indicators.mjs +5 -2
- package/resources/typing-indicators.mjs.map +1 -1
- package/resources/webhooks.d.mts +149 -145
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +149 -145
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +11 -57
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +11 -57
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +48 -22
- package/src/internal/parse.ts +6 -0
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/contacts/bulk.ts +24 -3
- package/src/resources/contacts/contacts.ts +113 -18
- package/src/resources/contacts/index.ts +1 -0
- package/src/resources/groups.ts +3 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/lookups.ts +3 -0
- package/src/resources/media-objects.ts +3 -0
- package/src/resources/messages.ts +52 -7
- package/src/resources/typing-indicators.ts +11 -2
- package/src/resources/webhooks.ts +185 -154
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,188 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.3.0 (2026-03-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v3.2.1...v3.3.0](https://github.com/sendblue-api/sendblue-ts/compare/v3.2.1...v3.3.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([b107aa8](https://github.com/sendblue-api/sendblue-ts/commit/b107aa873b66f947a186531267085a64055dcdc9))
|
|
10
|
+
|
|
11
|
+
## 3.2.1 (2026-03-06)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v3.2.0...v3.2.1](https://github.com/sendblue-api/sendblue-ts/compare/v3.2.0...v3.2.1)
|
|
14
|
+
|
|
15
|
+
### Chores
|
|
16
|
+
|
|
17
|
+
* update SDK settings ([7e64e27](https://github.com/sendblue-api/sendblue-ts/commit/7e64e275a067d5a2bfbead4d0fea2941cea1483b))
|
|
18
|
+
* update SDK settings ([46e52fe](https://github.com/sendblue-api/sendblue-ts/commit/46e52fece83a28b88e2fb0795556341d1cc44519))
|
|
19
|
+
|
|
20
|
+
## 3.2.0 (2026-03-06)
|
|
21
|
+
|
|
22
|
+
Full Changelog: [v3.1.1...v3.2.0](https://github.com/sendblue-api/sendblue-ts/compare/v3.1.1...v3.2.0)
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* **mcp:** add an option to disable code tool ([551e7b9](https://github.com/sendblue-api/sendblue-ts/commit/551e7b92e348e279dbfe6ed27ce6b3c331e87e0c))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* **docs/contributing:** correct pnpm link command ([fb21687](https://github.com/sendblue-api/sendblue-ts/commit/fb21687d9c02e1a0b2ffc1256b17d8f03b85b0a6))
|
|
32
|
+
* **mcp:** initialize SDK lazily to avoid failing the connection on init errors ([0b99f69](https://github.com/sendblue-api/sendblue-ts/commit/0b99f6924a49cdc17d09e5cdac932130f5b22a13))
|
|
33
|
+
* **mcp:** update prompt ([a18b1e8](https://github.com/sendblue-api/sendblue-ts/commit/a18b1e835a847cacc635fa581f84382de99f679e))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Chores
|
|
37
|
+
|
|
38
|
+
* **internal/client:** fix form-urlencoded requests ([0636408](https://github.com/sendblue-api/sendblue-ts/commit/06364085dd59f4b43b2f0f95b8bab83435fa9ffb))
|
|
39
|
+
* **internal:** allow setting x-stainless-api-key header on mcp server requests ([cdbf955](https://github.com/sendblue-api/sendblue-ts/commit/cdbf955893b151aa89778d292b3e041a476e0306))
|
|
40
|
+
* **internal:** cache fetch instruction calls in MCP server ([3c55910](https://github.com/sendblue-api/sendblue-ts/commit/3c5591018ee53d8e51d94100f6cafa0c02572046))
|
|
41
|
+
* **internal:** codegen related update ([e49dca6](https://github.com/sendblue-api/sendblue-ts/commit/e49dca68e4ac0ba9622646e228558b7f7d9c62d2))
|
|
42
|
+
* **internal:** codegen related update ([53f130a](https://github.com/sendblue-api/sendblue-ts/commit/53f130aaa02d1cfc0e8f2fe7bd727f5fa782ee36))
|
|
43
|
+
* **internal:** fix MCP Dockerfiles so they can be built without buildkit ([5ffec38](https://github.com/sendblue-api/sendblue-ts/commit/5ffec385386fb1f3608085e6661da0a9385b144c))
|
|
44
|
+
* **internal:** fix MCP Dockerfiles so they can be built without buildkit ([a6902b8](https://github.com/sendblue-api/sendblue-ts/commit/a6902b8ebc927578dacfa28672e8481e032bbb6b))
|
|
45
|
+
* **internal:** improve layout of generated MCP server files ([01a4563](https://github.com/sendblue-api/sendblue-ts/commit/01a45632c1ee8e9eec2a3995a1b7891059d1b101))
|
|
46
|
+
* **internal:** make MCP code execution location configurable via a flag ([b07fa5c](https://github.com/sendblue-api/sendblue-ts/commit/b07fa5c87e15e521b91692350d50849b1769e078))
|
|
47
|
+
* **internal:** move stringifyQuery implementation to internal function ([1b6af28](https://github.com/sendblue-api/sendblue-ts/commit/1b6af28ba8ae7d7c0ba33181297cc9ec6733b2ad))
|
|
48
|
+
* **internal:** remove mock server code ([f322a40](https://github.com/sendblue-api/sendblue-ts/commit/f322a40ea28a1b9251b0e296ef7ab92a6c8d7888))
|
|
49
|
+
* **internal:** upgrade @modelcontextprotocol/sdk and hono ([2d2c35f](https://github.com/sendblue-api/sendblue-ts/commit/2d2c35f86662b5389f3ab5e8863e60d13cda655c))
|
|
50
|
+
* **internal:** use x-stainless-mcp-client-envs header for MCP remote code tool calls ([23ec859](https://github.com/sendblue-api/sendblue-ts/commit/23ec859fdcaf0b3b629a44485cbfd2221fc5f0d4))
|
|
51
|
+
* **mcp-server:** return access instructions for 404 without API key ([9731f30](https://github.com/sendblue-api/sendblue-ts/commit/9731f3092be43d3e14b1eeaf7fa4ee17f3b07fba))
|
|
52
|
+
* **mcp:** correctly update version in sync with sdk ([45a3ed5](https://github.com/sendblue-api/sendblue-ts/commit/45a3ed52cc155a8be91982997764f5dda2987052))
|
|
53
|
+
* **mcp:** forward STAINLESS_API_KEY to docs search endpoint ([869a8aa](https://github.com/sendblue-api/sendblue-ts/commit/869a8aa557dfae546e648a5d92e86432703c2cff))
|
|
54
|
+
* update mock server docs ([32ba29c](https://github.com/sendblue-api/sendblue-ts/commit/32ba29c2431daee857b1a3eddc695e372cab3436))
|
|
55
|
+
|
|
56
|
+
## 3.1.1 (2026-02-12)
|
|
57
|
+
|
|
58
|
+
Full Changelog: [v3.1.0...v3.1.1](https://github.com/sendblue-api/sendblue-ts/compare/v3.1.0...v3.1.1)
|
|
59
|
+
|
|
60
|
+
### Chores
|
|
61
|
+
|
|
62
|
+
* **internal:** avoid type checking errors with ts-reset ([eb062d8](https://github.com/sendblue-api/sendblue-ts/commit/eb062d8439b9ae4511060ce3c54ab73cd4a44f11))
|
|
63
|
+
|
|
64
|
+
## 3.1.0 (2026-02-10)
|
|
65
|
+
|
|
66
|
+
Full Changelog: [v3.0.0...v3.1.0](https://github.com/sendblue-api/sendblue-ts/compare/v3.0.0...v3.1.0)
|
|
67
|
+
|
|
68
|
+
### Features
|
|
69
|
+
|
|
70
|
+
* **api:** manual updates ([bbfd8e6](https://github.com/sendblue-api/sendblue-ts/commit/bbfd8e663d2a2da218127ae391f028d42710e228))
|
|
71
|
+
* **mcp:** add initial server instructions ([60caebf](https://github.com/sendblue-api/sendblue-ts/commit/60caebf686850d8fcbe1abb390cb86ce210783dc))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Bug Fixes
|
|
75
|
+
|
|
76
|
+
* **client:** avoid memory leak with abort signals ([a024460](https://github.com/sendblue-api/sendblue-ts/commit/a0244605d744d1480eefb01eafd7c7a2d45740e7))
|
|
77
|
+
* **client:** avoid removing abort listener too early ([d448c50](https://github.com/sendblue-api/sendblue-ts/commit/d448c50fecae0a1f9291eec1584afb9ef9a6ddf9))
|
|
78
|
+
* **docs:** fix mcp installation instructions for remote servers ([b3ac217](https://github.com/sendblue-api/sendblue-ts/commit/b3ac217fb6bddb38ff9685c7d38749a56fa2a2bc))
|
|
79
|
+
* **mcp:** allow falling back for required env variables ([d03ff47](https://github.com/sendblue-api/sendblue-ts/commit/d03ff47b6f9621ff0afd8060b0e744f13a83f2cd))
|
|
80
|
+
* **mcp:** update code tool prompt ([711163b](https://github.com/sendblue-api/sendblue-ts/commit/711163b47679bdf489c40f4e7333af71024b9771))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Chores
|
|
84
|
+
|
|
85
|
+
* bump OpenAPI spec version to 1.1.0 ([2b6f263](https://github.com/sendblue-api/sendblue-ts/commit/2b6f26366649ffbb98c6e158a8ac44eb3b1742ef))
|
|
86
|
+
* **ci:** upgrade `actions/github-script` ([9bc5271](https://github.com/sendblue-api/sendblue-ts/commit/9bc52717197daade7c09f300ede5f49881f2e43f))
|
|
87
|
+
* **client:** do not parse responses with empty content-length ([f486b2a](https://github.com/sendblue-api/sendblue-ts/commit/f486b2a74eb6bbab1cfb9382cf3b6e4d5f87558f))
|
|
88
|
+
* **client:** restructure abort controller binding ([4a36480](https://github.com/sendblue-api/sendblue-ts/commit/4a364808e710c11bf4336468b949f9055e4df534))
|
|
89
|
+
* **internal:** add health check to MCP server when running in HTTP mode ([9cdee5c](https://github.com/sendblue-api/sendblue-ts/commit/9cdee5c9485c76225e2e3220dc2c8ef5df800b94))
|
|
90
|
+
* **internal:** allow basic filtering of methods allowed for MCP code mode ([95788ac](https://github.com/sendblue-api/sendblue-ts/commit/95788ac649d5b95cfde00eaca3229a620eb66a40))
|
|
91
|
+
* **internal:** always generate MCP server dockerfiles and upgrade associated dependencies ([d2a0484](https://github.com/sendblue-api/sendblue-ts/commit/d2a048428f15a55807ec2b9d6829bc44bc803022))
|
|
92
|
+
* **internal:** codegen related update ([26fabe7](https://github.com/sendblue-api/sendblue-ts/commit/26fabe771e094ea9218d87f161ea52b5e44a6d4f))
|
|
93
|
+
* **internal:** codegen related update ([f28ae45](https://github.com/sendblue-api/sendblue-ts/commit/f28ae4559128f5e4ed4a58d73175730e5c3bd0de))
|
|
94
|
+
* **internal:** codegen related update ([3a29296](https://github.com/sendblue-api/sendblue-ts/commit/3a2929613c058fa6331f50681864c8225202dba3))
|
|
95
|
+
* **internal:** codegen related update ([747b9c7](https://github.com/sendblue-api/sendblue-ts/commit/747b9c792696fb50c544f18d99469ddc94b5a8fc))
|
|
96
|
+
* **internal:** codegen related update ([5ba7ea0](https://github.com/sendblue-api/sendblue-ts/commit/5ba7ea02209345837c1178ec3aa3275b265dc7fd))
|
|
97
|
+
* **internal:** refactor flag parsing for MCP servers and add debug flag ([e212d08](https://github.com/sendblue-api/sendblue-ts/commit/e212d08807d41a605b0db29b515f3f3fa4999834))
|
|
98
|
+
* **internal:** support oauth authorization code flow for MCP servers ([f0d5fa3](https://github.com/sendblue-api/sendblue-ts/commit/f0d5fa3618f07e2f03bf27b31357bf4e9055b588))
|
|
99
|
+
* **internal:** update `actions/checkout` version ([1f87e00](https://github.com/sendblue-api/sendblue-ts/commit/1f87e00260e5c4188597620337001a8df7b76595))
|
|
100
|
+
* **internal:** update lock file ([7150196](https://github.com/sendblue-api/sendblue-ts/commit/7150196485cffa3057471768e0a7d38f83c070d1))
|
|
101
|
+
* **internal:** upgrade babel, qs, js-yaml ([52684c8](https://github.com/sendblue-api/sendblue-ts/commit/52684c84040d881cda2cb4916d25bd20ef06871c))
|
|
102
|
+
* **mcp:** add intent param to execute tool ([9c65910](https://github.com/sendblue-api/sendblue-ts/commit/9c65910da6c72205964777ef33fe75afefc518e2))
|
|
103
|
+
* **mcp:** pass intent param to execute handler ([944d6ba](https://github.com/sendblue-api/sendblue-ts/commit/944d6babb9da65378201d65e076f14d36a718243))
|
|
104
|
+
* **mcp:** up tsconfig lib version to es2022 ([8305c74](https://github.com/sendblue-api/sendblue-ts/commit/8305c74097abbb359b1aa53d730b80509c24d6ae))
|
|
105
|
+
* **mcp:** upgrade dependencies ([606b34a](https://github.com/sendblue-api/sendblue-ts/commit/606b34a52c62c4c893b2b5beab570f2760dbc26f))
|
|
106
|
+
|
|
107
|
+
## 3.0.0 (2026-01-08)
|
|
108
|
+
|
|
109
|
+
Full Changelog: [v2.2.0...v3.0.0](https://github.com/sendblue-api/sendblue-ts/compare/v2.2.0...v3.0.0)
|
|
110
|
+
|
|
111
|
+
### ⚠ BREAKING CHANGES
|
|
112
|
+
|
|
113
|
+
* **mcp:** remove deprecated tool schemes
|
|
114
|
+
* **mcp:** **Migration:** To migrate, simply modify the command used to invoke the MCP server. Currently, the only supported tool scheme is code mode. Now, starting the server with just `node /path/to/mcp/server` or `npx package-name` will invoke code tools: changing your command to one of these is likely all you will need to do.
|
|
115
|
+
|
|
116
|
+
### Features
|
|
117
|
+
|
|
118
|
+
* **api:** manual updates ([87a97a2](https://github.com/sendblue-api/sendblue-ts/commit/87a97a23741c894047a45fb401792d2a979cbe25))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
### Bug Fixes
|
|
122
|
+
|
|
123
|
+
* **mcp:** correct code tool api output types ([84064d9](https://github.com/sendblue-api/sendblue-ts/commit/84064d9c79f6e968818e9459d16c5b435c58bcd4))
|
|
124
|
+
* **mcp:** fix env parsing ([fad5cd0](https://github.com/sendblue-api/sendblue-ts/commit/fad5cd0c4f1291aef357c6d48f44e2c1a028c200))
|
|
125
|
+
* **mcp:** fix options parsing ([a06d3ac](https://github.com/sendblue-api/sendblue-ts/commit/a06d3ac05810ea852722759aaf7455d851f65563))
|
|
126
|
+
* **mcp:** pass base url to code tool ([84878ae](https://github.com/sendblue-api/sendblue-ts/commit/84878aea79874d1bca870777cdd8b1ccad6da877))
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
### Chores
|
|
130
|
+
|
|
131
|
+
* break long lines in snippets into multiline ([7c60251](https://github.com/sendblue-api/sendblue-ts/commit/7c6025103c2863fa2dccec5c0fc564c78f1c2096))
|
|
132
|
+
* **internal:** codegen related update ([b08c346](https://github.com/sendblue-api/sendblue-ts/commit/b08c346a1bd5eb5a55d213755ddd5fe3388dea59))
|
|
133
|
+
* **internal:** configure MCP Server hosting ([291480b](https://github.com/sendblue-api/sendblue-ts/commit/291480b6359c0441707cad3f5968c4250d6127de))
|
|
134
|
+
* **internal:** fix dockerfile ([a548ecf](https://github.com/sendblue-api/sendblue-ts/commit/a548ecf7b9f3358b195cbc58d4b3c4a2b788758e))
|
|
135
|
+
* **mcp:** remove deprecated tool schemes ([87b7056](https://github.com/sendblue-api/sendblue-ts/commit/87b705610f69ef6db4d92ac2eb3509398711fe2a))
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Documentation
|
|
139
|
+
|
|
140
|
+
* prominently feature MCP server setup in root SDK readmes ([4d8d46d](https://github.com/sendblue-api/sendblue-ts/commit/4d8d46d5fff0b624ed6abcaa156a8693bf55c3fa))
|
|
141
|
+
|
|
142
|
+
## 2.2.0 (2025-12-13)
|
|
143
|
+
|
|
144
|
+
Full Changelog: [v2.1.0...v2.2.0](https://github.com/sendblue-api/sendblue-ts/compare/v2.1.0...v2.2.0)
|
|
145
|
+
|
|
146
|
+
### Features
|
|
147
|
+
|
|
148
|
+
* **api:** manual updates ([184a587](https://github.com/sendblue-api/sendblue-ts/commit/184a5874cb34792f5addce731afc51209e609c08))
|
|
149
|
+
* **api:** manual updates ([59277e3](https://github.com/sendblue-api/sendblue-ts/commit/59277e375332443f56b8a335d57a4e1166b5c1f9))
|
|
150
|
+
* **api:** manual updates ([eeddf82](https://github.com/sendblue-api/sendblue-ts/commit/eeddf82b85057235736114c079a9f937229e04ec))
|
|
151
|
+
* **api:** manual updates ([e9f1453](https://github.com/sendblue-api/sendblue-ts/commit/e9f145336e1348a9806e31bacd21ef6e2a13ed50))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Bug Fixes
|
|
155
|
+
|
|
156
|
+
* **mcp:** add client instantiation options to code tool ([24583c9](https://github.com/sendblue-api/sendblue-ts/commit/24583c93d542b2d881634686b9abac13143435d6))
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### Chores
|
|
160
|
+
|
|
161
|
+
* **mcp:** update lockfile ([d7cb954](https://github.com/sendblue-api/sendblue-ts/commit/d7cb9548a2fa569f69de7339ea589a59f60a2c92))
|
|
162
|
+
|
|
163
|
+
## 2.1.0 (2025-12-06)
|
|
164
|
+
|
|
165
|
+
Full Changelog: [v2.0.2...v2.1.0](https://github.com/sendblue-api/sendblue-ts/compare/v2.0.2...v2.1.0)
|
|
166
|
+
|
|
167
|
+
### Features
|
|
168
|
+
|
|
169
|
+
* **api/v2/contact:** removed verified field in response example ([84e9eec](https://github.com/sendblue-api/sendblue-ts/commit/84e9eeccbeb4fbd17a8b0d996a9a23c9f37bbdcc))
|
|
170
|
+
* **mcp:** add typescript check to code execution tool ([98896e9](https://github.com/sendblue-api/sendblue-ts/commit/98896e9892dd3569c3367abc4a98f7c249d35464))
|
|
171
|
+
* **mcp:** handle code mode calls in the Stainless API ([9d72f3d](https://github.com/sendblue-api/sendblue-ts/commit/9d72f3d8a4754cd35271facefcaf54490df9dcff))
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
### Bug Fixes
|
|
175
|
+
|
|
176
|
+
* **mcp:** correct code tool API endpoint ([8546f73](https://github.com/sendblue-api/sendblue-ts/commit/8546f73c5d8620193684f1d8091a2ae59c384951))
|
|
177
|
+
* **mcp:** return correct lines on typescript errors ([d007cbd](https://github.com/sendblue-api/sendblue-ts/commit/d007cbd401f459106188126d1f801dbb364c3697))
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
### Chores
|
|
181
|
+
|
|
182
|
+
* **internal:** codegen related update ([ad57e05](https://github.com/sendblue-api/sendblue-ts/commit/ad57e057d311de42abc91b26759c91001fc8deb0))
|
|
183
|
+
* **internal:** codegen related update ([7665eac](https://github.com/sendblue-api/sendblue-ts/commit/7665eacb311050999d17a500150f3361acdfe1fc))
|
|
184
|
+
* use latest @modelcontextprotocol/sdk ([75e400a](https://github.com/sendblue-api/sendblue-ts/commit/75e400a940b77d4b1fe8c6a32304e6ae6ac06392))
|
|
185
|
+
|
|
3
186
|
## 2.0.2 (2025-12-03)
|
|
4
187
|
|
|
5
188
|
Full Changelog: [v2.0.1...v2.0.2](https://github.com/sendblue-api/sendblue-ts/compare/v2.0.1...v2.0.2)
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2026 Sendblue API
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -8,6 +8,15 @@ The REST API documentation can be found on [docs.sendblue.com](https://docs.send
|
|
|
8
8
|
|
|
9
9
|
It is generated with [Stainless](https://www.stainless.com/).
|
|
10
10
|
|
|
11
|
+
## MCP Server
|
|
12
|
+
|
|
13
|
+
Use the Sendblue API MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
|
|
14
|
+
|
|
15
|
+
[](https://cursor.com/en-US/install-mcp?name=sendblue-mcp&config=eyJuYW1lIjoic2VuZGJsdWUtbWNwIiwidHJhbnNwb3J0IjoiaHR0cCIsInVybCI6Imh0dHBzOi8vc2VuZGJsdWUtYXBpLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7InNiLWFwaS1rZXktaWQiOiJNeSBBUEkgS2V5Iiwic2ItYXBpLXNlY3JldC1rZXkiOiJNeSBBUEkgU2VjcmV0In19)
|
|
16
|
+
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22sendblue-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fsendblue-api.stlmcp.com%22%2C%22headers%22%3A%7B%22sb-api-key-id%22%3A%22My%20API%20Key%22%2C%22sb-api-secret-key%22%3A%22My%20API%20Secret%22%7D%7D)
|
|
17
|
+
|
|
18
|
+
> Note: You may need to set environment variables in your MCP client.
|
|
19
|
+
|
|
11
20
|
## Installation
|
|
12
21
|
|
|
13
22
|
```sh
|
|
@@ -68,7 +77,11 @@ a subclass of `APIError` will be thrown:
|
|
|
68
77
|
<!-- prettier-ignore -->
|
|
69
78
|
```ts
|
|
70
79
|
const messageResponse = await client.messages
|
|
71
|
-
.send({
|
|
80
|
+
.send({
|
|
81
|
+
content: 'REPLACE_ME',
|
|
82
|
+
from_number: 'REPLACE_ME',
|
|
83
|
+
number: 'REPLACE_ME',
|
|
84
|
+
})
|
|
72
85
|
.catch(async (err) => {
|
|
73
86
|
if (err instanceof SendblueAPI.APIError) {
|
|
74
87
|
console.log(err.status); // 400
|
|
@@ -109,7 +122,11 @@ const client = new SendblueAPI({
|
|
|
109
122
|
});
|
|
110
123
|
|
|
111
124
|
// Or, configure per-request:
|
|
112
|
-
await client.messages.send({
|
|
125
|
+
await client.messages.send({
|
|
126
|
+
content: 'REPLACE_ME',
|
|
127
|
+
from_number: 'REPLACE_ME',
|
|
128
|
+
number: 'REPLACE_ME',
|
|
129
|
+
}, {
|
|
113
130
|
maxRetries: 5,
|
|
114
131
|
});
|
|
115
132
|
```
|
|
@@ -126,7 +143,11 @@ const client = new SendblueAPI({
|
|
|
126
143
|
});
|
|
127
144
|
|
|
128
145
|
// Override per-request:
|
|
129
|
-
await client.messages.send({
|
|
146
|
+
await client.messages.send({
|
|
147
|
+
content: 'REPLACE_ME',
|
|
148
|
+
from_number: 'REPLACE_ME',
|
|
149
|
+
number: 'REPLACE_ME',
|
|
150
|
+
}, {
|
|
130
151
|
timeout: 5 * 1000,
|
|
131
152
|
});
|
|
132
153
|
```
|
|
@@ -150,13 +171,21 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
|
|
|
150
171
|
const client = new SendblueAPI();
|
|
151
172
|
|
|
152
173
|
const response = await client.messages
|
|
153
|
-
.send({
|
|
174
|
+
.send({
|
|
175
|
+
content: 'REPLACE_ME',
|
|
176
|
+
from_number: 'REPLACE_ME',
|
|
177
|
+
number: 'REPLACE_ME',
|
|
178
|
+
})
|
|
154
179
|
.asResponse();
|
|
155
180
|
console.log(response.headers.get('X-My-Header'));
|
|
156
181
|
console.log(response.statusText); // access the underlying Response object
|
|
157
182
|
|
|
158
183
|
const { data: messageResponse, response: raw } = await client.messages
|
|
159
|
-
.send({
|
|
184
|
+
.send({
|
|
185
|
+
content: 'REPLACE_ME',
|
|
186
|
+
from_number: 'REPLACE_ME',
|
|
187
|
+
number: 'REPLACE_ME',
|
|
188
|
+
})
|
|
160
189
|
.withResponse();
|
|
161
190
|
console.log(raw.headers.get('X-My-Header'));
|
|
162
191
|
console.log(messageResponse.account_email);
|
package/client.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ import { MediaObjectUploadParams, MediaObjectUploadResponse, MediaObjects } from
|
|
|
12
12
|
import { MessageContent, MessageGetStatusParams, MessageListParams, MessageListResponse, MessageResponse, MessageRetrieveResponse, MessageSendParams, Messages } from "./resources/messages.mjs";
|
|
13
13
|
import { TypingIndicatorSendParams, TypingIndicatorSendResponse, TypingIndicators } from "./resources/typing-indicators.mjs";
|
|
14
14
|
import { WebhookConfiguration, WebhookCreateParams, WebhookCreateResponse, WebhookDeleteParams, WebhookDeleteResponse, WebhookListResponse, WebhookUpdateParams, WebhookUpdateResponse, Webhooks } from "./resources/webhooks.mjs";
|
|
15
|
-
import { Contact, ContactCountResponse, ContactCreateParams, ContactCreateResponse, ContactDeleteResponse, ContactListResponse, ContactRetrieveResponse, ContactUpdateParams, ContactUpdateResponse, ContactVerifyParams, ContactVerifyResponse, Contacts } from "./resources/contacts/contacts.mjs";
|
|
15
|
+
import { Contact, ContactCountResponse, ContactCreateParams, ContactCreateResponse, ContactDeleteResponse, ContactListParams, ContactListResponse, ContactRetrieveResponse, ContactUpdateParams, ContactUpdateResponse, ContactVerifyParams, ContactVerifyResponse, Contacts } from "./resources/contacts/contacts.mjs";
|
|
16
16
|
import { type Fetch } from "./internal/builtin-types.mjs";
|
|
17
17
|
import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
|
|
18
18
|
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
|
|
@@ -129,7 +129,7 @@ export declare class SendblueAPI {
|
|
|
129
129
|
/**
|
|
130
130
|
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
131
131
|
*/
|
|
132
|
-
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
132
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string;
|
|
133
133
|
private getUserAgent;
|
|
134
134
|
protected defaultIdempotencyKey(): string;
|
|
135
135
|
protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
|
|
@@ -168,6 +168,7 @@ export declare class SendblueAPI {
|
|
|
168
168
|
timeout: number;
|
|
169
169
|
}>;
|
|
170
170
|
private buildHeaders;
|
|
171
|
+
private _makeAbort;
|
|
171
172
|
private buildBody;
|
|
172
173
|
static SendblueAPI: typeof SendblueAPI;
|
|
173
174
|
static DEFAULT_TIMEOUT: number;
|
|
@@ -185,12 +186,33 @@ export declare class SendblueAPI {
|
|
|
185
186
|
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
186
187
|
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
187
188
|
static toFile: typeof Uploads.toFile;
|
|
189
|
+
/**
|
|
190
|
+
* Operations for sending and managing messages
|
|
191
|
+
*/
|
|
188
192
|
messages: API.Messages;
|
|
193
|
+
/**
|
|
194
|
+
* Operations for group messaging (beta)
|
|
195
|
+
*/
|
|
189
196
|
groups: API.Groups;
|
|
197
|
+
/**
|
|
198
|
+
* Operations for uploading and managing media files
|
|
199
|
+
*/
|
|
190
200
|
mediaObjects: API.MediaObjects;
|
|
201
|
+
/**
|
|
202
|
+
* Operations for looking up service availability for phone numbers
|
|
203
|
+
*/
|
|
191
204
|
lookups: API.Lookups;
|
|
205
|
+
/**
|
|
206
|
+
* Operations for sending and managing messages
|
|
207
|
+
*/
|
|
192
208
|
typingIndicators: API.TypingIndicators;
|
|
209
|
+
/**
|
|
210
|
+
* Operations for managing contacts
|
|
211
|
+
*/
|
|
193
212
|
contacts: API.Contacts;
|
|
213
|
+
/**
|
|
214
|
+
* Operations for managing webhook subscriptions
|
|
215
|
+
*/
|
|
194
216
|
webhooks: API.Webhooks;
|
|
195
217
|
}
|
|
196
218
|
export declare namespace SendblueAPI {
|
|
@@ -200,7 +222,7 @@ export declare namespace SendblueAPI {
|
|
|
200
222
|
export { MediaObjects as MediaObjects, type MediaObjectUploadResponse as MediaObjectUploadResponse, type MediaObjectUploadParams as MediaObjectUploadParams, };
|
|
201
223
|
export { Lookups as Lookups, type LookupLookupNumberResponse as LookupLookupNumberResponse, type LookupLookupNumberParams as LookupLookupNumberParams, };
|
|
202
224
|
export { TypingIndicators as TypingIndicators, type TypingIndicatorSendResponse as TypingIndicatorSendResponse, type TypingIndicatorSendParams as TypingIndicatorSendParams, };
|
|
203
|
-
export { Contacts as Contacts, type Contact as Contact, type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactDeleteResponse as ContactDeleteResponse, type ContactCountResponse as ContactCountResponse, type ContactVerifyResponse as ContactVerifyResponse, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactVerifyParams as ContactVerifyParams, };
|
|
225
|
+
export { Contacts as Contacts, type Contact as Contact, type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactDeleteResponse as ContactDeleteResponse, type ContactCountResponse as ContactCountResponse, type ContactVerifyResponse as ContactVerifyResponse, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactVerifyParams as ContactVerifyParams, };
|
|
204
226
|
export { Webhooks as Webhooks, type WebhookConfiguration as WebhookConfiguration, type WebhookCreateResponse as WebhookCreateResponse, type WebhookUpdateResponse as WebhookUpdateResponse, type WebhookListResponse as WebhookListResponse, type WebhookDeleteResponse as WebhookDeleteResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookDeleteParams as WebhookDeleteParams, };
|
|
205
227
|
}
|
|
206
228
|
//# sourceMappingURL=client.d.mts.map
|
package/client.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAGT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,EAAE;OAC1E,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,OAAO,EAAE;OACjE,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,YAAY,EAAE;OACpE,EACL,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,QAAQ,EACT;OACM,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EACjB;OACM,EACL,oBAAoB,EAC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EACpC,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/client.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { MediaObjectUploadParams, MediaObjectUploadResponse, MediaObjects } from
|
|
|
12
12
|
import { MessageContent, MessageGetStatusParams, MessageListParams, MessageListResponse, MessageResponse, MessageRetrieveResponse, MessageSendParams, Messages } from "./resources/messages.js";
|
|
13
13
|
import { TypingIndicatorSendParams, TypingIndicatorSendResponse, TypingIndicators } from "./resources/typing-indicators.js";
|
|
14
14
|
import { WebhookConfiguration, WebhookCreateParams, WebhookCreateResponse, WebhookDeleteParams, WebhookDeleteResponse, WebhookListResponse, WebhookUpdateParams, WebhookUpdateResponse, Webhooks } from "./resources/webhooks.js";
|
|
15
|
-
import { Contact, ContactCountResponse, ContactCreateParams, ContactCreateResponse, ContactDeleteResponse, ContactListResponse, ContactRetrieveResponse, ContactUpdateParams, ContactUpdateResponse, ContactVerifyParams, ContactVerifyResponse, Contacts } from "./resources/contacts/contacts.js";
|
|
15
|
+
import { Contact, ContactCountResponse, ContactCreateParams, ContactCreateResponse, ContactDeleteResponse, ContactListParams, ContactListResponse, ContactRetrieveResponse, ContactUpdateParams, ContactUpdateResponse, ContactVerifyParams, ContactVerifyResponse, Contacts } from "./resources/contacts/contacts.js";
|
|
16
16
|
import { type Fetch } from "./internal/builtin-types.js";
|
|
17
17
|
import { HeadersLike, NullableHeaders } from "./internal/headers.js";
|
|
18
18
|
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.js";
|
|
@@ -129,7 +129,7 @@ export declare class SendblueAPI {
|
|
|
129
129
|
/**
|
|
130
130
|
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
131
131
|
*/
|
|
132
|
-
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
132
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string;
|
|
133
133
|
private getUserAgent;
|
|
134
134
|
protected defaultIdempotencyKey(): string;
|
|
135
135
|
protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
|
|
@@ -168,6 +168,7 @@ export declare class SendblueAPI {
|
|
|
168
168
|
timeout: number;
|
|
169
169
|
}>;
|
|
170
170
|
private buildHeaders;
|
|
171
|
+
private _makeAbort;
|
|
171
172
|
private buildBody;
|
|
172
173
|
static SendblueAPI: typeof SendblueAPI;
|
|
173
174
|
static DEFAULT_TIMEOUT: number;
|
|
@@ -185,12 +186,33 @@ export declare class SendblueAPI {
|
|
|
185
186
|
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
186
187
|
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
187
188
|
static toFile: typeof Uploads.toFile;
|
|
189
|
+
/**
|
|
190
|
+
* Operations for sending and managing messages
|
|
191
|
+
*/
|
|
188
192
|
messages: API.Messages;
|
|
193
|
+
/**
|
|
194
|
+
* Operations for group messaging (beta)
|
|
195
|
+
*/
|
|
189
196
|
groups: API.Groups;
|
|
197
|
+
/**
|
|
198
|
+
* Operations for uploading and managing media files
|
|
199
|
+
*/
|
|
190
200
|
mediaObjects: API.MediaObjects;
|
|
201
|
+
/**
|
|
202
|
+
* Operations for looking up service availability for phone numbers
|
|
203
|
+
*/
|
|
191
204
|
lookups: API.Lookups;
|
|
205
|
+
/**
|
|
206
|
+
* Operations for sending and managing messages
|
|
207
|
+
*/
|
|
192
208
|
typingIndicators: API.TypingIndicators;
|
|
209
|
+
/**
|
|
210
|
+
* Operations for managing contacts
|
|
211
|
+
*/
|
|
193
212
|
contacts: API.Contacts;
|
|
213
|
+
/**
|
|
214
|
+
* Operations for managing webhook subscriptions
|
|
215
|
+
*/
|
|
194
216
|
webhooks: API.Webhooks;
|
|
195
217
|
}
|
|
196
218
|
export declare namespace SendblueAPI {
|
|
@@ -200,7 +222,7 @@ export declare namespace SendblueAPI {
|
|
|
200
222
|
export { MediaObjects as MediaObjects, type MediaObjectUploadResponse as MediaObjectUploadResponse, type MediaObjectUploadParams as MediaObjectUploadParams, };
|
|
201
223
|
export { Lookups as Lookups, type LookupLookupNumberResponse as LookupLookupNumberResponse, type LookupLookupNumberParams as LookupLookupNumberParams, };
|
|
202
224
|
export { TypingIndicators as TypingIndicators, type TypingIndicatorSendResponse as TypingIndicatorSendResponse, type TypingIndicatorSendParams as TypingIndicatorSendParams, };
|
|
203
|
-
export { Contacts as Contacts, type Contact as Contact, type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactDeleteResponse as ContactDeleteResponse, type ContactCountResponse as ContactCountResponse, type ContactVerifyResponse as ContactVerifyResponse, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactVerifyParams as ContactVerifyParams, };
|
|
225
|
+
export { Contacts as Contacts, type Contact as Contact, type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactDeleteResponse as ContactDeleteResponse, type ContactCountResponse as ContactCountResponse, type ContactVerifyResponse as ContactVerifyResponse, type ContactCreateParams as ContactCreateParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactVerifyParams as ContactVerifyParams, };
|
|
204
226
|
export { Webhooks as Webhooks, type WebhookConfiguration as WebhookConfiguration, type WebhookCreateResponse as WebhookCreateResponse, type WebhookUpdateResponse as WebhookUpdateResponse, type WebhookListResponse as WebhookListResponse, type WebhookDeleteResponse as WebhookDeleteResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookDeleteParams as WebhookDeleteParams, };
|
|
205
227
|
}
|
|
206
228
|
//# sourceMappingURL=client.d.ts.map
|
package/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB,KAAK,IAAI;OAGT,KAAK,MAAM;OACX,KA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AmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/client.js
CHANGED
|
@@ -11,6 +11,7 @@ const errors_1 = require("./internal/errors.js");
|
|
|
11
11
|
const detect_platform_1 = require("./internal/detect-platform.js");
|
|
12
12
|
const Shims = tslib_1.__importStar(require("./internal/shims.js"));
|
|
13
13
|
const Opts = tslib_1.__importStar(require("./internal/request-options.js"));
|
|
14
|
+
const query_1 = require("./internal/utils/query.js");
|
|
14
15
|
const version_1 = require("./version.js");
|
|
15
16
|
const Errors = tslib_1.__importStar(require("./core/error.js"));
|
|
16
17
|
const Uploads = tslib_1.__importStar(require("./core/uploads.js"));
|
|
@@ -47,12 +48,33 @@ class SendblueAPI {
|
|
|
47
48
|
constructor({ baseURL = (0, env_1.readEnv)('SENDBLUE_API_BASE_URL'), apiKey = (0, env_1.readEnv)('SENDBLUE_API_API_KEY'), apiSecret = (0, env_1.readEnv)('SENDBLUE_API_API_SECRET'), ...opts } = {}) {
|
|
48
49
|
_SendblueAPI_instances.add(this);
|
|
49
50
|
_SendblueAPI_encoder.set(this, void 0);
|
|
51
|
+
/**
|
|
52
|
+
* Operations for sending and managing messages
|
|
53
|
+
*/
|
|
50
54
|
this.messages = new API.Messages(this);
|
|
55
|
+
/**
|
|
56
|
+
* Operations for group messaging (beta)
|
|
57
|
+
*/
|
|
51
58
|
this.groups = new API.Groups(this);
|
|
59
|
+
/**
|
|
60
|
+
* Operations for uploading and managing media files
|
|
61
|
+
*/
|
|
52
62
|
this.mediaObjects = new API.MediaObjects(this);
|
|
63
|
+
/**
|
|
64
|
+
* Operations for looking up service availability for phone numbers
|
|
65
|
+
*/
|
|
53
66
|
this.lookups = new API.Lookups(this);
|
|
67
|
+
/**
|
|
68
|
+
* Operations for sending and managing messages
|
|
69
|
+
*/
|
|
54
70
|
this.typingIndicators = new API.TypingIndicators(this);
|
|
71
|
+
/**
|
|
72
|
+
* Operations for managing contacts
|
|
73
|
+
*/
|
|
55
74
|
this.contacts = new API.Contacts(this);
|
|
75
|
+
/**
|
|
76
|
+
* Operations for managing webhook subscriptions
|
|
77
|
+
*/
|
|
56
78
|
this.webhooks = new API.Webhooks(this);
|
|
57
79
|
if (apiKey === undefined) {
|
|
58
80
|
throw new Errors.SendblueAPIError("The SENDBLUE_API_API_KEY environment variable is missing or empty; either provide it, or instantiate the SendblueAPI client with an apiKey option, like new SendblueAPI({ apiKey: 'My API Key' }).");
|
|
@@ -122,18 +144,7 @@ class SendblueAPI {
|
|
|
122
144
|
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
123
145
|
*/
|
|
124
146
|
stringifyQuery(query) {
|
|
125
|
-
return
|
|
126
|
-
.filter(([_, value]) => typeof value !== 'undefined')
|
|
127
|
-
.map(([key, value]) => {
|
|
128
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
129
|
-
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
130
|
-
}
|
|
131
|
-
if (value === null) {
|
|
132
|
-
return `${encodeURIComponent(key)}=`;
|
|
133
|
-
}
|
|
134
|
-
throw new Errors.SendblueAPIError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);
|
|
135
|
-
})
|
|
136
|
-
.join('&');
|
|
147
|
+
return (0, query_1.stringifyQuery)(query);
|
|
137
148
|
}
|
|
138
149
|
getUserAgent() {
|
|
139
150
|
return `${this.constructor.name}/JS ${version_1.VERSION}`;
|
|
@@ -298,9 +309,10 @@ class SendblueAPI {
|
|
|
298
309
|
}
|
|
299
310
|
async fetchWithTimeout(url, init, ms, controller) {
|
|
300
311
|
const { signal, method, ...options } = init || {};
|
|
312
|
+
const abort = this._makeAbort(controller);
|
|
301
313
|
if (signal)
|
|
302
|
-
signal.addEventListener('abort',
|
|
303
|
-
const timeout = setTimeout(
|
|
314
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
315
|
+
const timeout = setTimeout(abort, ms);
|
|
304
316
|
const isReadableBody = (globalThis.ReadableStream && options.body instanceof globalThis.ReadableStream) ||
|
|
305
317
|
(typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);
|
|
306
318
|
const fetchOptions = {
|
|
@@ -365,9 +377,9 @@ class SendblueAPI {
|
|
|
365
377
|
timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
|
|
366
378
|
}
|
|
367
379
|
}
|
|
368
|
-
// If the API asks us to wait a certain amount of time
|
|
369
|
-
//
|
|
370
|
-
if (
|
|
380
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
381
|
+
// says, but otherwise calculate a default
|
|
382
|
+
if (timeoutMillis === undefined) {
|
|
371
383
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
372
384
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
373
385
|
}
|
|
@@ -429,6 +441,11 @@ class SendblueAPI {
|
|
|
429
441
|
this.validateHeaders(headers);
|
|
430
442
|
return headers.values;
|
|
431
443
|
}
|
|
444
|
+
_makeAbort(controller) {
|
|
445
|
+
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
|
|
446
|
+
// would capture all request options, and cause a memory leak.
|
|
447
|
+
return () => controller.abort();
|
|
448
|
+
}
|
|
432
449
|
buildBody({ options: { body, headers: rawHeaders } }) {
|
|
433
450
|
if (!body) {
|
|
434
451
|
return { bodyHeaders: undefined, body: undefined };
|
|
@@ -457,6 +474,13 @@ class SendblueAPI {
|
|
|
457
474
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))) {
|
|
458
475
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body) };
|
|
459
476
|
}
|
|
477
|
+
else if (typeof body === 'object' &&
|
|
478
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded') {
|
|
479
|
+
return {
|
|
480
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
481
|
+
body: this.stringifyQuery(body),
|
|
482
|
+
};
|
|
483
|
+
}
|
|
460
484
|
else {
|
|
461
485
|
return tslib_1.__classPrivateFieldGet(this, _SendblueAPI_encoder, "f").call(this, { body, headers });
|
|
462
486
|
}
|