@trycourier/courier 3.1.0 → 3.2.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 CHANGED
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased][unreleased]
7
7
 
8
+ ## [v3.2.0] - 2021-11-18
9
+
10
+ - adds idempotency expiration support for send and send list endpoints
11
+
8
12
  ## [v3.1.0] - 2021-11-16
9
13
 
10
14
  - Expose additional type definitions for `getMessage`
@@ -181,7 +185,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
181
185
 
182
186
  ## v1.0.1 - 2019-07-12
183
187
 
184
- [unreleased]: https://github.com/trycourier/courier-node/compare/v3.1.0...HEAD
188
+ [unreleased]: https://github.com/trycourier/courier-node/compare/v3.2.0...HEAD
189
+ [v3.2.0]: https://github.com/trycourier/courier-node/compare/v3.1.0...v3.2.0
185
190
  [v3.1.0]: https://github.com/trycourier/courier-node/compare/v3.0.0...v3.1.0
186
191
  [v3.0.0]: https://github.com/trycourier/courier-node/compare/v2.8.0...v3.0.0
187
192
  [v2.8.0]: https://github.com/trycourier/courier-node/compare/v2.7.0...v2.8.0
package/lib/client.js CHANGED
@@ -55,6 +55,10 @@ var send = function (options) {
55
55
  if (config && config.idempotencyKey) {
56
56
  axiosConfig.headers["Idempotency-Key"] = config.idempotencyKey;
57
57
  }
58
+ if (config && config.idempotencyExpiry) {
59
+ axiosConfig.headers["x-idempotency-expiration"] =
60
+ config.idempotencyExpiry;
61
+ }
58
62
  return [4 /*yield*/, options.httpClient.post("/send", {
59
63
  brand: params.brand,
60
64
  data: params.data,
@@ -192,6 +192,10 @@ var send = function (options) {
192
192
  if (config && config.idempotencyKey) {
193
193
  axiosConfig.headers["Idempotency-Key"] = config.idempotencyKey;
194
194
  }
195
+ if (config && config.idempotencyExpiry) {
196
+ axiosConfig.headers["x-idempotency-expiration"] =
197
+ config.idempotencyExpiry;
198
+ }
195
199
  return [4 /*yield*/, options.httpClient.post("/send/list", params, axiosConfig)];
196
200
  case 1:
197
201
  res = _a.sent();
package/lib/types.d.ts CHANGED
@@ -31,6 +31,7 @@ export interface ICourierSendParameters {
31
31
  }
32
32
  export interface ICourierSendConfig {
33
33
  idempotencyKey?: string;
34
+ idempotencyExpiry?: number;
34
35
  }
35
36
  export interface ICourierSendResponse {
36
37
  messageId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/courier",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "A node.js module for communicating with the Courier REST API.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",