@trycourier/courier 3.15.0 → 3.16.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
+ ## [3.16.0]
9
+
10
+ - adds support for idempotency expiry to be passed in profiles and brands POST
11
+
8
12
  ## [3.15.0]
9
13
 
10
14
  - adds support for audit events
package/lib/brands.js CHANGED
@@ -86,6 +86,10 @@ exports.createBrand = function (options) {
86
86
  if (config && config.idempotencyKey) {
87
87
  axiosConfig.headers["Idempotency-Key"] = config.idempotencyKey;
88
88
  }
89
+ if (config && config.idempotencyExpiry) {
90
+ axiosConfig.headers["x-idempotency-expiration"] =
91
+ config.idempotencyExpiry;
92
+ }
89
93
  return [4 /*yield*/, options.httpClient.post("/brands", params, axiosConfig)];
90
94
  case 1:
91
95
  res = _a.sent();
package/lib/profile.js CHANGED
@@ -64,6 +64,10 @@ exports.mergeProfile = function (options) {
64
64
  if (config && config.idempotencyKey) {
65
65
  axiosConfig.headers["Idempotency-Key"] = config.idempotencyKey;
66
66
  }
67
+ if (config && config.idempotencyExpiry) {
68
+ axiosConfig.headers["x-idempotency-expiration"] =
69
+ config.idempotencyExpiry;
70
+ }
67
71
  return [4 /*yield*/, options.httpClient.post("/profiles/" + params.recipientId, {
68
72
  profile: params.profile
69
73
  }, axiosConfig)];
package/lib/types.d.ts CHANGED
@@ -81,6 +81,7 @@ export interface ICourierProfileListsPostParameters {
81
81
  }
82
82
  export interface ICourierProfilePostConfig {
83
83
  idempotencyKey?: string;
84
+ idempotencyExpiry?: number;
84
85
  }
85
86
  export interface ICourierProfilePostResponse {
86
87
  status: "SUCCESS";
@@ -278,6 +279,7 @@ export interface ICourierBrandParameters {
278
279
  }
279
280
  export interface ICourierBrandPostConfig {
280
281
  idempotencyKey?: string;
282
+ idempotencyExpiry?: number;
281
283
  }
282
284
  export interface ICourierBrandPutParameters extends ICourierBrandParameters {
283
285
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/courier",
3
- "version": "3.15.0",
3
+ "version": "3.16.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",