@commercetools/connect-payments-sdk 0.22.0 → 0.23.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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DefaultCommercetoolsAPI = void 0;
|
|
4
4
|
const platform_sdk_1 = require("@commercetools/platform-sdk");
|
|
5
|
-
const
|
|
5
|
+
const ts_client_1 = require("@commercetools/ts-client");
|
|
6
6
|
const cart_api_1 = require("./cart-api");
|
|
7
7
|
const payment_api_1 = require("./payment-api");
|
|
8
8
|
const order_api_1 = require("./order-api");
|
|
@@ -30,11 +30,13 @@ const createClient = (opts) => {
|
|
|
30
30
|
clientId: opts.clientId,
|
|
31
31
|
clientSecret: opts.clientSecret,
|
|
32
32
|
},
|
|
33
|
+
...(opts.httpClient ? { httpClient: opts.httpClient } : {}),
|
|
33
34
|
};
|
|
34
35
|
const httpMiddlewareOptions = {
|
|
35
36
|
host: opts.apiUrl,
|
|
36
37
|
//Enables SDK retries when CoCo returns a 503 error. It retries up to 10 times with an 200ms backoff.
|
|
37
38
|
enableRetry: true,
|
|
39
|
+
...(opts.httpClient ? { httpClient: opts.httpClient } : {}),
|
|
38
40
|
};
|
|
39
41
|
const correlationIdMiddlewareOptions = {
|
|
40
42
|
generate: () => {
|
|
@@ -43,7 +45,7 @@ const createClient = (opts) => {
|
|
|
43
45
|
return correlationID;
|
|
44
46
|
},
|
|
45
47
|
};
|
|
46
|
-
const ctpClient = new
|
|
48
|
+
const ctpClient = new ts_client_1.ClientBuilder()
|
|
47
49
|
.withClientCredentialsFlow(authMiddlewareOptions)
|
|
48
50
|
.withCorrelationIdMiddleware(correlationIdMiddlewareOptions)
|
|
49
51
|
.withHttpMiddleware(httpMiddlewareOptions)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools/connect-payments-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Payment SDK for commercetools payment connectors",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
],
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@commercetools-backend/loggers": "23.
|
|
19
|
-
"@commercetools/platform-sdk": "8.
|
|
20
|
-
"@commercetools/
|
|
18
|
+
"@commercetools-backend/loggers": "23.3.0",
|
|
19
|
+
"@commercetools/platform-sdk": "8.9.0",
|
|
20
|
+
"@commercetools/ts-client": "3.3.1",
|
|
21
21
|
"jsonwebtoken": "9.0.2",
|
|
22
22
|
"jwks-rsa": "3.2.0",
|
|
23
23
|
"lodash": "4.17.21",
|